Fix error when access deleted org
This commit is contained in:
parent
3da6a25867
commit
f36a5497e0
1 changed files with 4 additions and 2 deletions
|
@ -157,7 +157,9 @@ class OrganizationMixin(OrganizationBase):
|
||||||
class AdminOrganizationMixin(OrganizationMixin):
|
class AdminOrganizationMixin(OrganizationMixin):
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
res = super(AdminOrganizationMixin, self).dispatch(request, *args, **kwargs)
|
res = super(AdminOrganizationMixin, self).dispatch(request, *args, **kwargs)
|
||||||
if self.can_edit_organization(self.organization):
|
if not hasattr(self, "organization") or self.can_edit_organization(
|
||||||
|
self.organization
|
||||||
|
):
|
||||||
return res
|
return res
|
||||||
return generic_message(
|
return generic_message(
|
||||||
request,
|
request,
|
||||||
|
@ -170,7 +172,7 @@ class AdminOrganizationMixin(OrganizationMixin):
|
||||||
class MemberOrganizationMixin(OrganizationMixin):
|
class MemberOrganizationMixin(OrganizationMixin):
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
res = super(MemberOrganizationMixin, self).dispatch(request, *args, **kwargs)
|
res = super(MemberOrganizationMixin, self).dispatch(request, *args, **kwargs)
|
||||||
if self.can_access(self.organization):
|
if not hasattr(self, "organization") or self.can_access(self.organization):
|
||||||
return res
|
return res
|
||||||
return generic_message(
|
return generic_message(
|
||||||
request,
|
request,
|
||||||
|
|
Loading…
Reference in a new issue