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

Update models.py - Referencing the User model #127

Merged
merged 6 commits into from
Nov 3, 2023

Conversation

artursniegowski
Copy link
Contributor

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#models

What specific section or headline is this issue about?

Django Tutorial Part 8: User authentication and permissions -> Models -> Referencing the User model

Description of Possible Improvement

Referencing the User model as described in the django documentation https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model . This ensures that projects working with custom User models will also function correctly, and I believe this is considered best practice for referencing the user model in Django.

Description

I have adjusted the way the user model is being referenced in the models.py file because I believe the method shown in the documentation doesn't represent the recommended way of referencing it.

Motivation

I believe that these changes are necessary in order to follow the best practices for referencing the user model. Additionally, when defining custom user models, the method provided in the documentation would not work, potentially leading to future problems with the project.

Additional details

Here the link from the Django docuemntation suporting my point:
https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model

Related issues and pull requests

Referencing the User model as described in the django documentation https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model . This ensures that projects working with custom User models will also function correctly, and I believe this is considered best practice for referencing the user model in Django.
@github-actions
Copy link

It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@hamishwillee
Copy link
Collaborator

Thanks very much. You're right. There's going to be some delay though, because we need to make corresponding changes to MDN content.

Co-authored-by: Özgür <ozgurturkiye@gmail.com>
Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much. I'm going to merge this. Still waiting on the MDN-side PR though.

@hamishwillee hamishwillee merged commit 0fcfea3 into mdn:main Nov 3, 2023
2 checks passed
Copy link

github-actions bot commented Nov 3, 2023

Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution.

@artursniegowski artursniegowski deleted the patch-1 branch November 3, 2023 11:24
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.

3 participants