forked from DGNum/gestioCOF
Ajout groupes K-Fêt utilisateurs en lecture
- Pour voir les groupes, il faut la permission `kfet.manage_perms` - Pour modifier les groupes auxquels fait parti un compte, il la faut également
This commit is contained in:
parent
8507072c8f
commit
e64a443fb3
9 changed files with 198 additions and 67 deletions
|
@ -1,6 +1,6 @@
|
|||
from django import forms
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.forms import modelformset_factory
|
||||
from kfet.models import (Account, Checkout, Article, OperationGroup, Operation,
|
||||
CheckoutStatement)
|
||||
|
@ -78,9 +78,20 @@ class UserForm(forms.ModelForm):
|
|||
}
|
||||
|
||||
class UserRestrictForm(UserForm):
|
||||
class Meta(UserForm.Meta):
|
||||
fields = ['first_name', 'last_name']
|
||||
|
||||
class UserRestrictTeamForm(UserForm):
|
||||
class Meta(UserForm.Meta):
|
||||
fields = ['first_name', 'last_name', 'email']
|
||||
|
||||
class UserGroupForm(forms.ModelForm):
|
||||
groups = forms.ModelMultipleChoiceField(
|
||||
Group.objects.filter(name__icontains='K-Fêt'))
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['groups']
|
||||
|
||||
# -----
|
||||
# Checkout forms
|
||||
# -----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue