2023-10-13 11:37:26 +00:00
|
|
|
from django import forms
|
|
|
|
from django.contrib.auth.models import User
|
2023-10-19 13:20:06 +00:00
|
|
|
from idhub.models import Rol
|
2023-10-13 11:37:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProfileForm(forms.ModelForm):
|
2023-10-13 19:04:44 +00:00
|
|
|
MANDATORY_FIELDS = ['first_name', 'last_name', 'email', 'username']
|
2023-10-13 11:37:26 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = User
|
2023-10-16 17:08:18 +00:00
|
|
|
fields = ('first_name', 'last_name', 'email')
|
|
|
|
|
|
|
|
|
|
|
|
class MembershipForm(forms.ModelForm):
|
|
|
|
MANDATORY_FIELDS = ['type']
|
|
|
|
|
2023-10-17 11:40:34 +00:00
|
|
|
|
|
|
|
class RolForm(forms.ModelForm):
|
|
|
|
MANDATORY_FIELDS = ['name']
|
|
|
|
|
2023-10-17 13:49:56 +00:00
|
|
|
|
|
|
|
class ServiceForm(forms.ModelForm):
|
|
|
|
MANDATORY_FIELDS = ['domain', 'rol']
|
|
|
|
|
2023-10-19 13:20:06 +00:00
|
|
|
|
2023-10-17 15:42:48 +00:00
|
|
|
class UserRolForm(forms.ModelForm):
|
|
|
|
MANDATORY_FIELDS = ['service']
|