From dcf2e43d579f767f88949f436b27a7a39fe87ea7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 14 Oct 2024 11:34:52 +0200 Subject: [PATCH] we don't need for the moment edit profile of user --- user/views.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/user/views.py b/user/views.py index d64d2e9..23ebb27 100644 --- a/user/views.py +++ b/user/views.py @@ -1,5 +1,5 @@ from decouple import config -from django.urls import reverse +from django.urls import reverse, reverse_lazy from django.http import HttpResponse from django.shortcuts import render from django.utils.translation import gettext_lazy as _ @@ -48,34 +48,3 @@ class SettingsView(DashboardView, FormView): kwargs['tokens'] = tokens return kwargs -class ProfileView(DashboardView): - template_name = "profile.html" - subtitle = _('My personal data') - icon = 'bi bi-person-gear' - fields = ('first_name', 'last_name', 'email') - success_url = reverse_lazy('idhub:user_profile') - model = User - - def get_queryset(self, **kwargs): - queryset = Membership.objects.select_related('user').filter( - user=self.request.user) - - return queryset - - def get_object(self): - return self.request.user - - def get_form(self): - form = super().get_form() - return form - - def form_valid(self, form): - return super().form_valid(form) - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - context.update({ - 'lang': self.request.LANGUAGE_CODE, - }) - return context -