[Answered ]-Django RegexValidator fails on empty string

2👍

The validator is never called in your save method when the string is empty:

if self.username: # an empty string will not pass this condition
    self.username = validate_username(self.username)

Leave a comment