mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-06 18:15:17 +00:00
Fix #600
This commit is contained in:
parent
ef968f3673
commit
e4894d27ad
@ -719,8 +719,12 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs = super(UserPreferencesView, self).get_context_data(**kwargs)
|
||||
if not hasattr(self.object, "trombi_user"):
|
||||
|
||||
if not (
|
||||
hasattr(self.object, "trombi_user") and self.request.user.trombi_user.trombi
|
||||
):
|
||||
kwargs["trombi_form"] = UserTrombiForm()
|
||||
|
||||
if hasattr(self.object, "customer"):
|
||||
kwargs["student_card_form"] = StudentCardForm()
|
||||
return kwargs
|
||||
|
@ -14,8 +14,8 @@
|
||||
<hr>
|
||||
<h4>{% trans %}Add user{% endtrans %}</h4>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="{% trans %}Add{% endtrans %}" />
|
||||
</form>
|
||||
<hr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user