feat(dgsi.views): Add a view to create users
This commit is contained in:
parent
2642a64116
commit
2817054e7e
2 changed files with 9 additions and 1 deletions
|
@ -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"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue