summaryrefslogtreecommitdiffstats
path: root/users/views/settings/security.py
blob: 31c2b22d27c5031d0650d27dbe2b3e468e894b63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from django import forms
from django.utils.decorators import method_decorator
from django.views.generic import FormView

from users.decorators import identity_required


@method_decorator(identity_required, name="dispatch")
class SecurityPage(FormView):
    """
    Lets the identity's profile be edited
    """

    template_name = "settings/login_security.html"
    extra_context = {"section": "security"}

    class form_class(forms.Form):
        email = forms.EmailField(
            disabled=True,
            help_text="Your email address cannot be changed yet.",
        )

    def get_initial(self):
        return {"email": self.request.user.email}

    template_name = "settings/login_security.html"