Creating translation files fails because circular import
The following exception is printed for all apps with permissions while using ./dev.sh makemessages
to create translation files:
Traceback (most recent call last):
File "/home/wethjo/dev/AlekSIS/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/wethjo/.cache/pypoetry/virtualenvs/aleksis-9WSQE4wq-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/home/wethjo/.cache/pypoetry/virtualenvs/aleksis-9WSQE4wq-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 377, in execute
django.setup()
File "/home/wethjo/.cache/pypoetry/virtualenvs/aleksis-9WSQE4wq-py3.8/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/wethjo/.cache/pypoetry/virtualenvs/aleksis-9WSQE4wq-py3.8/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/wethjo/.cache/pypoetry/virtualenvs/aleksis-9WSQE4wq-py3.8/lib/python3.8/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/wethjo/dev/AlekSIS/aleksis/core/rules.py", line 1, in <module>
from rules import add_perm, always_allow
ImportError: cannot import name 'add_perm' from partially initialized module 'rules' (most likely due to a circular import) (/home/wethjo/dev/AlekSIS/aleksis/core/rules.py)