MinimumLengthValidator
Validate that the password is of a minimum length.
Attributes
| Attribute | Type | Description |
|---|---|---|
| min_length | int = 8 | The minimum number of characters required for a password to be considered valid. |
Constructor
Signature
def MinimumLengthValidator(
min_length: int = 8
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| min_length | int = 8 | The minimum number of characters required for a password to be considered valid. |
Signature
def MinimumLengthValidator(
min_length: int = 8
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| min_length | int = 8 | The minimum number of characters required for a password to be considered valid |
Methods
validate()
@classmethod
def validate(
password: string,
user: object = null
) - > null
Validate that the password is of a minimum length.
Parameters
| Name | Type | Description |
|---|---|---|
| password | string | The raw password string to be evaluated for length compliance |
| user | object = null | The user object associated with the password, though not used in this specific validation logic |
Returns
| Type | Description |
|---|---|
null | None if validation passes; otherwise raises a ValidationError |
get_error_message()
@classmethod
def get_error_message() - > string
Constructs a localized error message indicating that the password does not meet the minimum length requirement.
Returns
| Type | Description |
|---|---|
string | A translated string explaining the length requirement, formatted with the specific minimum length |
get_help_text()
@classmethod
def get_help_text() - > string
Provides a localized hint to be displayed in UI forms to inform users of the password length requirement.
Returns
| Type | Description |
|---|---|
string | A translated instructional string stating the minimum number of characters required |