Fix 404 error for deleted org

This commit is contained in:
cuom1999 2023-02-21 14:20:14 -06:00
parent 9d42119a09
commit 603b251511

View file

@ -139,7 +139,9 @@ class OrganizationMixin(OrganizationBase):
self.organization_id = int(kwargs["pk"]) self.organization_id = int(kwargs["pk"])
self.organization = get_object_or_404(Organization, id=self.organization_id) self.organization = get_object_or_404(Organization, id=self.organization_id)
except Http404: except Http404:
key = kwargs.get(self.slug_url_kwarg, None) key = None
if hasattr(self, "slug_url_kwarg"):
key = kwargs.get(self.slug_url_kwarg, None)
if key: if key:
return generic_message( return generic_message(
request, request,