django__django-11099
UsernameValidator allows trailing newline in usernames
Verdict: the fix is stated in the issue (Tier A).
You can avoid this behavior by instead using \A and \Z to terminate regexes. For example, the validator regex could be changed to r'\A[\w.@+-]+\Z' in order to reject usernames that end with a newline.
The text states the fix: “You can avoid this behavior by instead using \A and \Z to terminate regexes. For example, the validator regex could be changed to r'\A[\w.@+-]+\Z' in order to reject use…”
All SWE-bench Verified tasks · more django/django tasks · How the check works