diff --git a/django_ace/widgets.py b/django_ace/widgets.py index ec4df40..659ec75 100644 --- a/django_ace/widgets.py +++ b/django_ace/widgets.py @@ -66,7 +66,7 @@ class AceWidget(forms.Textarea): if self.toolbar: toolbar = ( '
" ).format(self.width) html = toolbar + html diff --git a/judge/views/organization.py b/judge/views/organization.py index 54d6adb..0a3fc31 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -671,21 +671,13 @@ class OrganizationRequestBaseView( LoginRequiredMixin, SingleObjectTemplateResponseMixin, SingleObjectMixin, + AdminOrganizationMixin, ): model = Organization slug_field = "key" slug_url_kwarg = "key" tab = None - def get_object(self, queryset=None): - organization = super(OrganizationRequestBaseView, self).get_object(queryset) - if not ( - organization.admins.filter(id=self.request.profile.id).exists() - or organization.registrant_id == self.request.profile.id - ): - raise PermissionDenied() - return organization - def get_content_title(self): return _("Manage join requests") diff --git a/resources/common.js b/resources/common.js index e89061f..3c4e138 100644 --- a/resources/common.js +++ b/resources/common.js @@ -386,44 +386,230 @@ function activateBlogBoxOnClick() { } function changeTabParameter(newTab) { - const url = new URL(window.location); - const searchParams = new URLSearchParams(url.search); - searchParams.set('tab', newTab); - searchParams.delete('page'); - url.search = searchParams.toString(); - return url.href; + const url = new URL(window.location); + const searchParams = new URLSearchParams(url.search); + searchParams.set('tab', newTab); + searchParams.delete('page'); + url.search = searchParams.toString(); + return url.href; } function submitFormWithParams($form, method) { - const currentUrl = new URL(window.location.href); - const searchParams = new URLSearchParams(currentUrl.search); - const formData = $form.serialize(); + const currentUrl = new URL(window.location.href); + const searchParams = new URLSearchParams(currentUrl.search); + const formData = $form.serialize(); - const params = new URLSearchParams(formData); + const params = new URLSearchParams(formData); - if (searchParams.has('tab')) { - params.set('tab', searchParams.get('tab')); - } + if (searchParams.has('tab')) { + params.set('tab', searchParams.get('tab')); + } - const fullUrl = currentUrl.pathname + '?' + params.toString(); + const fullUrl = currentUrl.pathname + '?' + params.toString(); - if (method === "GET") { - window.location.href = fullUrl; - } - else { - var $formToSubmit = $('