Skip to content

Commit

Permalink
Fix AppRegistryNotReady error
Browse files Browse the repository at this point in the history
The checks that Djongo runs on the `model_container` requires all apps to be loaded, but the checks are run while the models are being loaded. The app can, therefore, not start.

This PR addresses this issue.
  • Loading branch information
mishrag authored and nesdis committed May 14, 2020
1 parent b5bbe1f commit 645346e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djongo/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self,
super().__init__(*args, **kwargs)

def _validate_container(self):
for field in self.model_container._meta.get_fields():
for field in self.model_container._meta._get_fields(reverse=False):
if isinstance(field, (AutoField,
BigAutoField,
RelatedField)):
Expand Down

0 comments on commit 645346e

Please sign in to comment.