account_views
main.views.account_views
¤
Views for the account-related pages of the main app.
Classes¤
AccountOverviewView
¤
Bases: TermsAcceptedMixin, RedirectView
Route users to the appropriate account page based on their skills.
Methods:¤
get_redirect_url(*args, **kwargs)
¤
Redirect to skill profile if skills exist, otherwise self-assess.
Source code in main/views/account_views.py
115 116 117 118 119 | |
AuthenticatedHttpRequest
¤
Bases: HttpRequest
Custom HttpRequest type for authenticated users.
SelfAssessPageView
¤
Bases: TermsAcceptedMixin, FormView[UserSkillsForm]
View that renders the self-assessment questionnaire page.
Methods:¤
form_valid(form)
¤
Handle valid form submission.
Source code in main/views/account_views.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
get_form_kwargs()
¤
Return the keyword arguments for instantiating the form.
Source code in main/views/account_views.py
144 145 146 147 148 | |
SkillProfileView
¤
Bases: TermsAcceptedMixin, TemplateView
View that renders the skill profile page.
Methods:¤
get_context_data(**kwargs)
¤
Add user skills and skill levels to the template context.
Source code in main/views/account_views.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
TermsAcceptanceView
¤
Bases: LoginRequiredMixin, FormView[TermsAcceptanceForm]
Prompt authenticated users to accept terms before continuing.
Methods:¤
form_valid(form)
¤
Persist acceptance and the acceptance timestamp.
Source code in main/views/account_views.py
65 66 67 68 69 70 71 | |
TermsAcceptedMixin
¤
Bases: LoginRequiredMixin
Require authenticated users to accept terms before accessing account pages.
Methods:¤
dispatch(request, *args, **kwargs)
¤
Redirect to terms acceptance page when the user has not accepted terms.
Source code in main/views/account_views.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
UserUpdateView
¤
Bases: TermsAcceptedMixin, UpdateView['UserType', ModelForm['UserType']]
View that renders the user update form page.
Methods:¤
get_object(queryset=None)
¤
Remove the need for url args by returning the current user.
Source code in main/views/account_views.py
131 132 133 | |