diff --git a/src/dgsi/urls.py b/src/dgsi/urls.py index cc2e0d0..38c0e0c 100644 --- a/src/dgsi/urls.py +++ b/src/dgsi/urls.py @@ -6,4 +6,5 @@ app_name = "dgsi" urlpatterns = [ path("accounts/profile/", views.ProfileView.as_view(), name="dgn-profile"), + path("accounts/create/", views.CreateUserView.as_view(), name="dgn-create_user"), ] diff --git a/src/dgsi/views.py b/src/dgsi/views.py index 75ebf1f..5515f8f 100644 --- a/src/dgsi/views.py +++ b/src/dgsi/views.py @@ -1,6 +1,13 @@ from django.contrib.auth.mixins import LoginRequiredMixin -from django.views.generic import TemplateView +from django.views.generic import CreateView, TemplateView + +from dgsi.mixins import StaffRequiredMixin +from dgsi.models import User class ProfileView(LoginRequiredMixin, TemplateView): template_name = "account/profile.html" + + +class CreateUserView(StaffRequiredMixin, CreateView): + model = User