Fix submission page bug in subdomain

This commit is contained in:
cuom1999 2023-01-27 16:52:35 -06:00
parent 65eb49a840
commit 9a208ca108
2 changed files with 6 additions and 2 deletions

View file

@ -114,5 +114,6 @@ class SubdomainMiddleware(object):
reverse("auth_login") + "?next=" + urlquote(request.path) reverse("auth_login") + "?next=" + urlquote(request.path)
) )
except ObjectDoesNotExist: except ObjectDoesNotExist:
pass scheme = "https" if settings.DMOJ_SSL > 0 else "http"
return HttpResponseRedirect(scheme + "://" + site)
return self.get_response(request) return self.get_response(request)

View file

@ -783,7 +783,10 @@ class AllSubmissions(SubmissionsListBase):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(AllSubmissions, self).get_context_data(**kwargs) context = super(AllSubmissions, self).get_context_data(**kwargs)
context["dynamic_update"] = context["page_obj"].number == 1 print(self.request.organization)
context["dynamic_update"] = (
context["page_obj"].number == 1
) and not self.request.organization
context["last_msg"] = event.last() context["last_msg"] = event.last()
context["stats_update_interval"] = self.stats_update_interval context["stats_update_interval"] = self.stats_update_interval
return context return context