mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-05 10:24:15 +00:00
add show_my_timetable to VisibilityForm
This commit is contained in:
1 parent
5a9ed1342b
commit
12fa99eb50
1 file changed
+4
-2
+4
-2
@@ -339,7 +339,7 @@ class UserVisibilityForm(forms.ModelForm):
|
|||||||
["show_my_stats", "show_my_timetable"],
|
["show_my_stats", "show_my_timetable"],
|
||||||
widgets={
|
widgets={
|
||||||
"show_my_stats": forms.CheckboxInput(attrs={"class": "switch"}),
|
"show_my_stats": forms.CheckboxInput(attrs={"class": "switch"}),
|
||||||
"show_my_timetable": forms.CheckboxInput(attrs={"class": "switch"})
|
"show_my_timetable": forms.CheckboxInput(attrs={"class": "switch"}),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
show_my_stats = __preferences_fields["show_my_stats"]
|
show_my_stats = __preferences_fields["show_my_stats"]
|
||||||
@@ -358,7 +358,9 @@ class UserVisibilityForm(forms.ModelForm):
|
|||||||
instance = super().save(commit=commit)
|
instance = super().save(commit=commit)
|
||||||
if commit:
|
if commit:
|
||||||
instance.preferences.show_my_stats = self.cleaned_data["show_my_stats"]
|
instance.preferences.show_my_stats = self.cleaned_data["show_my_stats"]
|
||||||
instance.preferences.show_my_timetable = self.cleaned_data["show_my_timetable"]
|
instance.preferences.show_my_timetable = self.cleaned_data[
|
||||||
|
"show_my_timetable"
|
||||||
|
]
|
||||||
instance.preferences.save()
|
instance.preferences.save()
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user