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):
|
def get_context_data(self, **kwargs):
|
||||||
kwargs = super(UserPreferencesView, self).get_context_data(**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()
|
kwargs["trombi_form"] = UserTrombiForm()
|
||||||
|
|
||||||
if hasattr(self.object, "customer"):
|
if hasattr(self.object, "customer"):
|
||||||
kwargs["student_card_form"] = StudentCardForm()
|
kwargs["student_card_form"] = StudentCardForm()
|
||||||
return kwargs
|
return kwargs
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<h4>{% trans %}Add user{% endtrans %}</h4>
|
<h4>{% trans %}Add user{% endtrans %}</h4>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p() }}
|
{{ form.as_p() }}
|
||||||
<input type="submit" value="{% trans %}Add{% endtrans %}" />
|
<input type="submit" value="{% trans %}Add{% endtrans %}" />
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user