flask-security
flask-security copied to clipboard
Allow override of Username
Currently, one can overload Username
text on the register form by doing the following:
from flask_security.forms import _default_field_labels
from flask_security.utils import _
_default_field_labels["username"] = _("Callsign")
The text is calculated at run time because get_register_username_field
is a callable.
However, since the login form uses login_username_field
, which is a variable not a callable, the text is calculated at import, not at run time.
This PR changes the login_username_field
variable, to a callable, allowing the Username
text value to be changed using the same method as the register form.