feat(dgsi.views): Add a view to create users

This commit is contained in:
Tom Hubrecht 2024-09-14 15:53:10 +02:00
parent 2642a64116
commit 2817054e7e
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 9 additions and 1 deletions

View file

@ -6,4 +6,5 @@ app_name = "dgsi"
urlpatterns = [ urlpatterns = [
path("accounts/profile/", views.ProfileView.as_view(), name="dgn-profile"), path("accounts/profile/", views.ProfileView.as_view(), name="dgn-profile"),
path("accounts/create/", views.CreateUserView.as_view(), name="dgn-create_user"),
] ]

View file

@ -1,6 +1,13 @@
from django.contrib.auth.mixins import LoginRequiredMixin 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): class ProfileView(LoginRequiredMixin, TemplateView):
template_name = "account/profile.html" template_name = "account/profile.html"
class CreateUserView(StaffRequiredMixin, CreateView):
model = User