create_user util will convert the username and email to lowercase before creating a user model object. So by default, the displayed values as stored in the database will be all lowercase although this can be modified from the admin panel. (The lookups will still be case-insensitive so only the display of the field's value will be affected)
Fixes #30
Changes:
UnicodeUsernameValidator
to username validators - Allows Unicode characters, in addition to@
,.
,+
,-
, and_
. (https://docs.djangoproject.com/en/2.2/ref/contrib/auth/#django.contrib.auth.validators.UnicodeUsernameValidator)create_user
util similar to thecreate_model_object
util added in https://github.com/Hyperlog/hyperlog-backend/commit/df8dcf6decbd034efff57268dda58564b577c45c (Specifically - https://github.com/Hyperlog/hyperlog-backend/commit/df8dcf6decbd034efff57268dda58564b577c45c#diff-eb4efe9389e0818d7e376f750bccd277R32). Another util was required because we needed support forpassword
field.create_user
util will convert the username and email to lowercase before creating a user model object. So by default, the displayed values as stored in the database will be all lowercase although this can be modified from the admin panel. (The lookups will still be case-insensitive so only the display of the field's value will be affected)Note: This PR overwrites some part of the
register
mutation. So the error log displayed will be slightly different from the last commit https://github.com/Hyperlog/hyperlog-backend/commit/df8dcf6decbd034efff57268dda58564b577c45c in that it won't show the specific username/email that was supplied in case of a unique constraint error.