1 from django.contrib.auth.mixins import LoginRequiredMixin
2 from django.contrib import messages
3 from django.utils.translation import gettext as _
4 from django.views.generic.edit import UpdateView
5 from accounts.forms import UserBasicForm
8 class ProfileView(LoginRequiredMixin, UpdateView):
9 form_class = UserBasicForm
10 template_name = "account/profile.html"
11 success_url = '/accounts/'
14 return self.request.user
16 def form_valid(self, form):
17 retval = super().form_valid(form)
18 messages.add_message(self.request, messages.INFO, _("Profile has been changed."))