diff --git a/core/views/user.py b/core/views/user.py index e9694a92..91649549 100644 --- a/core/views/user.py +++ b/core/views/user.py @@ -559,10 +559,6 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView): context_object_name = "profile" current_tab = "prefs" - def get_object(self, queryset=None): - user = get_object_or_404(User, pk=self.kwargs["user_id"]) - return user - def get_form_kwargs(self): kwargs = super().get_form_kwargs() pref = self.object.preferences @@ -572,9 +568,7 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView): def get_context_data(self, **kwargs): kwargs = super().get_context_data(**kwargs) - if not ( - hasattr(self.object, "trombi_user") and self.request.user.trombi_user.trombi - ): + if not hasattr(self.object, "trombi_user"): kwargs["trombi_form"] = UserTrombiForm() if hasattr(self.object, "customer"):