From 603b2515110ac26b411d389da742e2140a2a4a7c Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 21 Feb 2023 14:20:14 -0600 Subject: [PATCH] Fix 404 error for deleted org --- judge/views/organization.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/judge/views/organization.py b/judge/views/organization.py index c03ee37..8f9eace 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -139,7 +139,9 @@ class OrganizationMixin(OrganizationBase): self.organization_id = int(kwargs["pk"]) self.organization = get_object_or_404(Organization, id=self.organization_id) 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: return generic_message( request,