flexmeasures.auth.forms

Flask-Security forms that respect self-service password grants.

Classes

class flexmeasures.auth.forms.FlexMeasuresChangePasswordForm(*args, **kwargs)

Require the same grant for authenticated password changes.

validate(**kwargs) → bool

Validate the form by calling validate on each field. Returns True if validation passes.

If the form defines a validate_<fieldname> method, it is appended as an extra validator for the field’s validate.

Parameters:

extra_validators – A dict mapping field names to lists of extra validator methods to run. Extra validators run after validators passed when creating the field. If the form has validate_<fieldname>, it is the last extra validator.

class flexmeasures.auth.forms.FlexMeasuresForgotPasswordForm(*args, **kwargs)

Require a grant before sending password recovery instructions.

validate(**kwargs) → bool

Validate the form by calling validate on each field. Returns True if validation passes.

If the form defines a validate_<fieldname> method, it is appended as an extra validator for the field’s validate.

Parameters:

extra_validators – A dict mapping field names to lists of extra validator methods to run. Extra validators run after validators passed when creating the field. If the form has validate_<fieldname>, it is the last extra validator.