core: fix error 500 when editing properties of user without linked customer

This commit is contained in:
Antoine Bartuccio 2019-09-15 17:05:07 +02:00
parent 3eb8292d15
commit 63ec5d68f4
Signed by: klmp200
GPG Key ID: E7245548C53F904B

View File

@ -743,7 +743,7 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
kwargs = super(UserPreferencesView, self).get_context_data(**kwargs)
if not hasattr(self.object, "trombi_user"):
kwargs["trombi_form"] = UserTrombiForm()
if self.object.customer:
if hasattr(self.object, "customer"):
kwargs["student_card_form"] = StudentCardForm()
return kwargs