From 8f15e327b8e2b2350d9e57da9d4cb603a3680c17 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 17 Oct 2022 19:32:13 -0500 Subject: [PATCH] Fix logged out bug for most recent organizations --- judge/views/organization.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/judge/views/organization.py b/judge/views/organization.py index 1fd7c1a..c2b1435 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -127,7 +127,6 @@ class OrganizationMixin(OrganizationBase): context["logo_override_image"] = self.organization.logo_override_image if "organizations" in context: context.pop("organizations") - OrganizationProfile.add_organization(self.request.profile, self.organization) return context def dispatch(self, request, *args, **kwargs): @@ -152,6 +151,11 @@ class OrganizationMixin(OrganizationBase): return HttpResponsePermanentRedirect( request.get_full_path().replace(kwargs["slug"], self.organization.slug) ) + if self.request.user.is_authenticated: + OrganizationProfile.add_organization( + self.request.profile, self.organization + ) + return super(OrganizationMixin, self).dispatch(request, *args, **kwargs)