Skip to content

Bug in Validations.py under "validate_user" function #37272

@k-naula97

Description

@k-naula97

Issue is with the behavior of "validate_user" function in validations.py.
This script should validate usernames if they start with a letter only.

to fix this issue change:
if not re.match('^[a-z0-9._]*$', username) AND if username[0].isnumeric():

it should be:

if not re.match(r'^[A-Za-z0-9._]*$', username)
if not username[0].isalpha():

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions