django-form-designer
django-form-designer copied to clipboard
Circular import with get_user_model
Its fine to import, but if you import a model from this app from within your own models.py file, it will cause a circular error due to the get_user_model() running from within the code. see http://stackoverflow.com/questions/17469682/django-1-5-accessing-custom-user-model-fields-in-models-py for a very relevant case and how they solved.
The Django documentation has the answer: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.get_user_model
The most relevant section: Generally speaking, you should reference the User model with the AUTH_USER_MODEL setting in code that is executed at import time. get_user_model() only works once Django has imported all models.
The problem is models.py::formlog::created_by field. This field is not inside any method. So if you import this from your own models it will crash. a fix would be to put this inside a method or change it to use the AUTH_USER_MODEL setting.