From e2d3d115917cf5f3a048067df790bad5c4e59510 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 1 Mar 2023 21:37:16 -0600 Subject: [PATCH] Fix bug when org is deleted --- judge/views/organization.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/judge/views/organization.py b/judge/views/organization.py index 8f9eace..5904f85 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -147,12 +147,14 @@ class OrganizationMixin(OrganizationBase): request, _("No such organization"), _('Could not find an organization with the key "%s".') % key, + status=403, ) else: return generic_message( request, _("No such organization"), _("Could not find such organization."), + status=403, ) if self.organization.slug != kwargs["slug"]: return HttpResponsePermanentRedirect( @@ -326,6 +328,8 @@ class OrganizationUsers(QueryStringSortMixin, OrganizationMixin, FeedView): def dispatch(self, 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: return res return generic_message(