PacktPublishing / Django-5-By-Example

Django 5 By Example (5th Edition) published by Packt
https://djangobyexample.com/
MIT License
214 stars 92 forks source link

Preventing users from signing up with the username "follow" #21

Open HBarotov opened 3 months ago

HBarotov commented 3 months ago

I added a clean_username method to the UserRegistrationForm in chapter 7, to ensure that users cannot create a username with 'follow' or different variant thereof.

I also created a User = get_user_model() variable at the top of the file as in the original code User is not defined, which is mentioned in this issue #16.