mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 07:41:14 +00:00
Merge pull request #958 from ae-utbm/fix-group-form
fix user groups form
This commit is contained in:
commit
baebc0b690
@ -285,13 +285,14 @@ class UserProfileForm(forms.ModelForm):
|
|||||||
self._post_clean()
|
self._post_clean()
|
||||||
|
|
||||||
|
|
||||||
class UserRealGroupForm(forms.ModelForm):
|
class UserGroupsForm(forms.ModelForm):
|
||||||
error_css_class = "error"
|
error_css_class = "error"
|
||||||
required_css_class = "required"
|
required_css_class = "required"
|
||||||
|
|
||||||
groups = forms.ModelChoiceField(
|
groups = forms.ModelMultipleChoiceField(
|
||||||
RealGroup.objects.all(),
|
queryset=RealGroup.objects.all(),
|
||||||
widget=CheckboxSelectMultiple,
|
widget=CheckboxSelectMultiple,
|
||||||
|
label=_("Groups"),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -67,8 +67,8 @@ from core.views.forms import (
|
|||||||
LoginForm,
|
LoginForm,
|
||||||
RegisteringForm,
|
RegisteringForm,
|
||||||
UserGodfathersForm,
|
UserGodfathersForm,
|
||||||
|
UserGroupsForm,
|
||||||
UserProfileForm,
|
UserProfileForm,
|
||||||
UserRealGroupForm,
|
|
||||||
)
|
)
|
||||||
from counter.models import Refilling, Selling
|
from counter.models import Refilling, Selling
|
||||||
from counter.views.student_card import StudentCardFormView
|
from counter.views.student_card import StudentCardFormView
|
||||||
@ -583,7 +583,7 @@ class UserUpdateGroupView(UserTabsMixin, CanEditPropMixin, UpdateView):
|
|||||||
model = User
|
model = User
|
||||||
pk_url_kwarg = "user_id"
|
pk_url_kwarg = "user_id"
|
||||||
template_name = "core/user_group.jinja"
|
template_name = "core/user_group.jinja"
|
||||||
form_class = UserRealGroupForm
|
form_class = UserGroupsForm
|
||||||
context_object_name = "profile"
|
context_object_name = "profile"
|
||||||
current_tab = "groups"
|
current_tab = "groups"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user