From 63ec5d68f4850eb03542be6b3bc08a74940361ba Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Sun, 15 Sep 2019 17:05:07 +0200 Subject: [PATCH] core: fix error 500 when editing properties of user without linked customer --- core/views/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/views/user.py b/core/views/user.py index 63135872..aa3ea805 100644 --- a/core/views/user.py +++ b/core/views/user.py @@ -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