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

Avoid circular import issues. #18

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Avoid circular import issues. #18

merged 1 commit into from
Mar 10, 2021

Conversation

TSolo315
Copy link
Contributor

@TSolo315 TSolo315 commented Mar 9, 2021

Django documentation recommends using settings.AUTH_USER_MODEL over get_user_model() when you define a foreign key or many-to-many relation to the user model.

https://docs.djangoproject.com/en/3.1/topics/auth/customizing/

helped fix a circular import issue in my project.

Copy link
Owner

@abhiabhi94 abhiabhi94 left a comment

Choose a reason for hiding this comment

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

Thank you for taking the time to contribute.

It would be nice if you could incorporate the changes requested on the specific lines.

In addition, it would be great if you could change the ones mentioned below as well. It will allow consistency throughout the codebase.`

User = get_user_model()

User = get_user_model()

flag/models.py Outdated Show resolved Hide resolved
flag/utils.py Outdated Show resolved Hide resolved
tests/base.py Outdated Show resolved Hide resolved
@abhiabhi94
Copy link
Owner

Also, could you please squash your commits into one? It will help us maintain a clean git history.

flag/utils.py Outdated Show resolved Hide resolved
flag/utils.py Outdated Show resolved Hide resolved
@abhiabhi94
Copy link
Owner

could you please squash your commits into one? it will help us in maintaining a clean git history.

Base automatically changed from master to main March 10, 2021 06:45
@abhiabhi94
Copy link
Owner

can you update your branch with the latest changes from the main branch? I have updated the continuous integration process.

- move call to get_user_model from a module level to function level in utils.
- use settings.AUTH_USER_MODEL in models.
@abhiabhi94 abhiabhi94 merged commit 8a3c35e into abhiabhi94:main Mar 10, 2021
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.

Use of `get_user_model' at module level in manager causes circular import
2 participants