-
Notifications
You must be signed in to change notification settings - Fork 50
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
Remove model imports in any utils/ modules #443
Comments
Hi! Is this issue still awaiting resolution? If so, I'd like to take a look at it. I'm a uni student who's currently taking an open source course, which includes making contributions. |
Yes, still unresolved. The import in question is:
In many cases, A solution can be verified by using the >>> from ansible_base.lib.utils import *
>>> from ansible_base.lib.utils.models import * The first line is successful, but the 2nd line errors. Make that not error, and this is solved. |
Alright, I'll start working on this then, thanks for the quick reply! I'm quite new to contributing to ansible, is there a certain Matrix room I could ask questions regarding django-ansible-base? |
This fixes issue [443](#443). Imports of AbstractUser are now inline in the functions that use it, also added new import "annotations" in order to handle the functions which had AbstractUser in type hints. Please let me know if I need to add some additional information or if something needs fixing, this is my first PR here!
To prevent circular imports, we want ansible_base/utils imports to always be "safe" to import inside of Django apps.
Right now this doesn't work due to a stray import of
AbstractUser
which needs apps to be loaded before importing (or will throw an error).This can be done by moving these imports in-line, or more elegantly, but further code refactoring.
The text was updated successfully, but these errors were encountered: