Skip to content

Add display_name to user

The User model gain a non-nullable display_name attribute, initialized in the migration to the first part of the email:

  • bastien.abadie@gmail.com should become Bastien Abadie
  • quick & dirty : re.sub('[^\w]', ' ', email[:email.index('@')]).title()

Make sure the user creation still works:

  1. ./manage.py createsuperuser
  2. adding a user through admin
  3. user signup

These 3 actions should require setting a display name