NumericPasswordValidator
Validate that the password is not entirely numeric.
Methods
validate()
@classmethod
def validate(
password: string,
user: object = None
) - > null
Validate that the password is not entirely numeric.
Parameters
| Name | Type | Description |
|---|---|---|
| password | string | The raw password string to be checked for numeric content. |
| user | object = None | The user object associated with the password, though it is not used in this specific validation logic. |
Returns
| Type | Description |
|---|---|
null | Returns nothing if validation passes; otherwise, raises a ValidationError if the password consists only of digits. |
get_error_message()
@classmethod
def get_error_message() - > string
Returns the localized error message string used when a password fails the numeric validation check.
Returns
| Type | Description |
|---|---|
string | A translated string stating that the password is entirely numeric. |
get_help_text()
@classmethod
def get_help_text() - > string
Provides a localized hint to the user explaining the password requirement regarding numeric characters.
Returns
| Type | Description |
|---|---|
string | A translated string informing the user that passwords cannot be entirely numeric. |