diff --git a/courses/templates/category/create.html b/courses/templates/category/create.html index 814a0c6..45b1403 100644 --- a/courses/templates/category/create.html +++ b/courses/templates/category/create.html @@ -1,6 +1,6 @@ {% extends 'app/base.html' %} -{% load static i18n %} +{% load static i18n permission_tags %} {% load widget_tweaks %} {% block breadcrumbs %} @@ -11,20 +11,37 @@ {% endblock %} {% block sidebar %} -
- - {% trans 'Categories' %} - + + +{% if user|has_role:'professor, system_admin' %} + + +{% endif %} + {% endblock %} {% block content %} -
{% csrf_token %} diff --git a/courses/templates/course/index.html b/courses/templates/course/index.html index eb580b5..d6265a3 100644 --- a/courses/templates/course/index.html +++ b/courses/templates/course/index.html @@ -33,6 +33,7 @@
diff --git a/courses/views.py b/courses/views.py index 17a3a26..16a137b 100644 --- a/courses/views.py +++ b/courses/views.py @@ -216,11 +216,6 @@ class CreateCatView(LoginRequiredMixin, HasRoleMixin, generic.edit.CreateView): form_class = CategoryCourseForm success_url = reverse_lazy('course:manage_cat') - def render_to_response(self, context, **response_kwargs): - messages.success(self.request, _('Category created successfully!')) - - return self.response_class(request=self.request, template=self.get_template_names(), context=context, using=self.template_engine) - class UpdateCatView(LoginRequiredMixin, HasRoleMixin, generic.UpdateView): allowed_roles = ['professor', 'system_admin'] -- libgit2 0.21.2