diff --git a/app/YtManagerApp/templates/YtManagerApp/settings_admin.html b/app/YtManagerApp/templates/YtManagerApp/settings_admin.html index 35bf333..d2027e8 100644 --- a/app/YtManagerApp/templates/YtManagerApp/settings_admin.html +++ b/app/YtManagerApp/templates/YtManagerApp/settings_admin.html @@ -4,8 +4,16 @@ {% block body %}
+

Admin settings

- {% crispy form %} + + {% if not request.user.is_authenticated or not request.user.is_superuser %} + + {% else %} + {% crispy form %} + {% endif %}
{% endblock body %} \ No newline at end of file diff --git a/app/YtManagerApp/views/settings.py b/app/YtManagerApp/views/settings.py index ac4f8ad..15819f8 100644 --- a/app/YtManagerApp/views/settings.py +++ b/app/YtManagerApp/views/settings.py @@ -24,12 +24,6 @@ class AdminSettingsView(LoginRequiredMixin, FormView): template_name = 'YtManagerApp/settings_admin.html' success_url = reverse_lazy('home') - def get(self, request, *args, **kwargs): - if not request.user.is_authenticated or not request.user.is_superuser: - return HttpResponseForbidden() - - return super().get(request, *args, **kwargs) - def post(self, request, *args, **kwargs): if not request.user.is_authenticated or not request.user.is_superuser: return HttpResponseForbidden()