mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-21 23:31:18 +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()
|
||||
|
||||
|
||||
class UserRealGroupForm(forms.ModelForm):
|
||||
class UserGroupsForm(forms.ModelForm):
|
||||
error_css_class = "error"
|
||||
required_css_class = "required"
|
||||
|
||||
groups = forms.ModelChoiceField(
|
||||
RealGroup.objects.all(),
|
||||
groups = forms.ModelMultipleChoiceField(
|
||||
queryset=RealGroup.objects.all(),
|
||||
widget=CheckboxSelectMultiple,
|
||||
label=_("Groups"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -67,8 +67,8 @@ from core.views.forms import (
|
||||
LoginForm,
|
||||
RegisteringForm,
|
||||
UserGodfathersForm,
|
||||
UserGroupsForm,
|
||||
UserProfileForm,
|
||||
UserRealGroupForm,
|
||||
)
|
||||
from counter.models import Refilling, Selling
|
||||
from counter.views.student_card import StudentCardFormView
|
||||
@ -583,7 +583,7 @@ class UserUpdateGroupView(UserTabsMixin, CanEditPropMixin, UpdateView):
|
||||
model = User
|
||||
pk_url_kwarg = "user_id"
|
||||
template_name = "core/user_group.jinja"
|
||||
form_class = UserRealGroupForm
|
||||
form_class = UserGroupsForm
|
||||
context_object_name = "profile"
|
||||
current_tab = "groups"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user