Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Model Change #114

Merged
merged 13 commits into from
Mar 8, 2024
Merged

User Model Change #114

merged 13 commits into from
Mar 8, 2024

Conversation

jazwu
Copy link
Contributor

@jazwu jazwu commented Mar 8, 2024

Description

Since I am implementing the reset password view which requires authentication, I discovered that our user model is incomplete according to the Django User Model tutorial, which hinders the implementation of authentication-related views such as a reset password view. Therefore, I made some modifications to models.py:

  • modified User: added fields like is_active, is_superuser, and is_staff

After researching Django authentication system views tutorial, I think using email as unique identifier instead of username would make life easier. In this way, we don't need to add "forgot the username" on the login page.

  • modified CustomUserManager: set email and password as credentials
  • modified User: set email as unique identifier and make username as a required field

Additionally,

  • capitalized the names of the current model classes to align with Django's standard
  • registered User model in admin.py so that we can deal with Users through /admin page

@jazwu jazwu merged commit 31d1920 into develop Mar 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants