mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Add first Matmat' app
This commit is contained in:
@ -46,6 +46,7 @@ from core.views.forms import RegisteringForm, UserPropForm, UserProfileForm, Log
|
||||
from core.models import User, SithFile, Preferences
|
||||
from club.models import Club
|
||||
from subscription.models import Subscription
|
||||
from matmat.views import UserMatmatForm
|
||||
|
||||
def login(request):
|
||||
"""
|
||||
@ -427,7 +428,7 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
|
||||
"""
|
||||
model = User
|
||||
pk_url_kwarg = "user_id"
|
||||
template_name = "core/edit.jinja"
|
||||
template_name = "core/user_preferences.jinja"
|
||||
form_class = modelform_factory(Preferences, fields=['receive_weekmail'])
|
||||
context_object_name = "profile"
|
||||
current_tab = "prefs"
|
||||
@ -446,6 +447,12 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
|
||||
kwargs.update({'instance': pref})
|
||||
return kwargs
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs = super(UserPreferencesView, self).get_context_data(**kwargs)
|
||||
if not hasattr(self.object, 'matmat_user'):
|
||||
kwargs['matmat_form'] = UserMatmatForm()
|
||||
return kwargs
|
||||
|
||||
class UserUpdateGroupView(UserTabsMixin, CanEditPropMixin, UpdateView):
|
||||
"""
|
||||
Edit a user's groups
|
||||
|
Reference in New Issue
Block a user