This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/core/views/user.py

22 lines
697 B
Python
Raw Normal View History

"""passbook core user views"""
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _
2020-05-12 13:21:53 +00:00
from django.views.generic import UpdateView
2020-05-10 22:49:48 +00:00
from passbook.core.forms.users import UserDetailForm
class UserSettingsView(SuccessMessageMixin, LoginRequiredMixin, UpdateView):
"""Update User settings"""
2019-02-26 09:57:05 +00:00
2019-12-31 11:51:16 +00:00
template_name = "user/settings.html"
form_class = UserDetailForm
2019-12-31 11:51:16 +00:00
success_message = _("Successfully updated user.")
success_url = reverse_lazy("passbook_core:user-settings")
def get_object(self):
return self.request.user