we don't need for the moment edit profile of user

This commit is contained in:
Cayo Puigdefabregas 2024-10-14 11:34:52 +02:00
parent 4b9875157c
commit dcf2e43d57
1 changed files with 1 additions and 32 deletions

View File

@ -1,5 +1,5 @@
from decouple import config from decouple import config
from django.urls import reverse from django.urls import reverse, reverse_lazy
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render from django.shortcuts import render
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -48,34 +48,3 @@ class SettingsView(DashboardView, FormView):
kwargs['tokens'] = tokens kwargs['tokens'] = tokens
return kwargs 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