ferrosoft.apps.ferrobase.session package¶
Submodules¶
ferrosoft.apps.ferrobase.session.forms module¶
- class ferrosoft.apps.ferrobase.session.forms.ResetPasswordForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]¶
Bases:
FormForm collecting the username to begin a password reset flow.
- base_fields = {'username': <django.forms.fields.CharField object>}¶
- declared_fields = {'username': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class ferrosoft.apps.ferrobase.session.forms.SetNewPasswordForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]¶
Bases:
FormForm collecting and confirming the new password during reset completion.
- base_fields = {'password': <django.forms.fields.CharField object>, 'password_again': <django.forms.fields.CharField object>}¶
- declared_fields = {'password': <django.forms.fields.CharField object>, 'password_again': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
ferrosoft.apps.ferrobase.session.password_reset module¶
Password reset email dispatch using templated messages.
- exception ferrosoft.apps.ferrobase.session.password_reset.UserMissingEmail[source]¶
Bases:
ExceptionRaised when a password reset is attempted for a user without an email address.
- ferrosoft.apps.ferrobase.session.password_reset.send_password_reset_email(reset_req, http_req, sender_address=None)[source]¶
Render and send the password reset email for a pending reset request.
The mail body is rendered from the
ferrobase/session/reset-password-mail.htmltemplate and contains a tokenised link back to theset_new_passwordview.- Parameters:
reset_req (
PasswordResetRequest) – The persisted reset-request record carrying the user and access key.http_req (
HttpRequest) – The current HTTP request, used solely to build an absolute URI for the reset link.sender_address (
str) – Optional sender address. Falls back to the DjangoDEFAULT_FROM_EMAILsetting when omitted.
- Raises:
UserMissingEmail – If the target user has no email address recorded.
Exception – Any underlying mail-backend error is propagated; the call uses
fail_silently=False.