mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-08-05 02:34:35 +02:00
User and permission management
This commit is contained in:
parent
3177eb2b8d
commit
f036daf779
10 changed files with 296 additions and 10 deletions
|
@ -3,6 +3,7 @@ from django.contrib.auth.models import User
|
|||
from django.contrib import auth
|
||||
from .forms import CreateUserForm, LoginForm
|
||||
from django.http import HttpResponse
|
||||
from user_manager.models import UserAcl
|
||||
|
||||
|
||||
def view_create_first_user(request):
|
||||
|
@ -13,7 +14,8 @@ def view_create_first_user(request):
|
|||
if form.is_valid():
|
||||
username = form.cleaned_data['username']
|
||||
password = form.cleaned_data['password']
|
||||
User.objects.create_superuser(username=username, password=password)
|
||||
new_user = User.objects.create_superuser(username=username, password=password)
|
||||
UserAcl.objects.create(user=new_user, user_level=50)
|
||||
return render(request, 'accounts/superuser_created.html')
|
||||
else:
|
||||
form = CreateUserForm()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue