Fix bug when org is deleted

This commit is contained in:
cuom1999 2023-03-01 21:37:16 -06:00
parent cf31735e80
commit e2d3d11591

View file

@ -147,12 +147,14 @@ class OrganizationMixin(OrganizationBase):
request, request,
_("No such organization"), _("No such organization"),
_('Could not find an organization with the key "%s".') % key, _('Could not find an organization with the key "%s".') % key,
status=403,
) )
else: else:
return generic_message( return generic_message(
request, request,
_("No such organization"), _("No such organization"),
_("Could not find such organization."), _("Could not find such organization."),
status=403,
) )
if self.organization.slug != kwargs["slug"]: if self.organization.slug != kwargs["slug"]:
return HttpResponsePermanentRedirect( return HttpResponsePermanentRedirect(
@ -326,6 +328,8 @@ class OrganizationUsers(QueryStringSortMixin, OrganizationMixin, FeedView):
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
res = super(OrganizationUsers, self).dispatch(request, *args, **kwargs) res = super(OrganizationUsers, self).dispatch(request, *args, **kwargs)
if res.status_code != 200:
return res
if self.can_access(self.organization) or self.organization.is_open: if self.can_access(self.organization) or self.organization.is_open:
return res return res
return generic_message( return generic_message(