This commit is contained in:
2025-10-02 00:54:34 +02:00
commit 84b34c9615
200 changed files with 42048 additions and 0 deletions

16
backend/account/forms.py Normal file
View File

@@ -0,0 +1,16 @@
from django import forms
from django.contrib.auth.forms import UserCreationForm
from .models import CustomUser # adjust import to your app
#using: admin.py
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = CustomUser
fields = ("username", "email", "role", "account_type", "password1", "password2")
def save(self, commit=True):
user = super().save(commit=False)
# Optional logic: assign role-based permissions here if needed
if commit:
user.save()
return user