Skip to main content

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

NameTypeDescription
passwordstringThe raw password string to be checked for numeric content.
userobject = NoneThe user object associated with the password, though it is not used in this specific validation logic.

Returns

TypeDescription
nullReturns 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

TypeDescription
stringA 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

TypeDescription
stringA translated string informing the user that passwords cannot be entirely numeric.