Changes between Initial Version and Version 1 of Ticket #30111, comment 2


Ignore:
Timestamp:
Jan 17, 2019, 3:24:56 PM (6 years ago)
Author:
Nasir Hussain

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30111, comment 2

    initial v1  
    66When contrib.postgres is in INSTALLED_APPS it triggers from **django.db.migrations.writer import MigrationWriter** import in [https://github.com/django/django/blob/7185ea6902532eb195d0575d1bf1492ca9d45dea/django/contrib/postgres/apps.py#L8 django/django/contrib/postgres/apps.py] which further triggered **app_config = apps.get_containing_app_config(module)** import in [https://github.com/django/django/blob/7185ea6902532eb195d0575d1bf1492ca9d45dea/django/db/models/base.py#L99 ModelBase] Meta class.
    77ModelBase checks for self.check_apps_ready() while apps have not been completely loaded yet. So an exception is raised **raise AppRegistryNotReady("Apps aren't loaded yet.")**
    8 I've changed **django/django/contrib/postgres/apps.py** to import MigrationWriter only when needed to avoid **check for apps ready** cycle to fix the issue
     8Fix: I've changed **django/django/contrib/postgres/apps.py** to import MigrationWriter only when needed to avoid **check for apps ready** cycle.
    99
    1010
Back to Top