Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make model checks safer
Browse files Browse the repository at this point in the history
If the test database is not set up, this check used to crash when
running manage.py check.
jacobtylerwalls committed Nov 19, 2024
1 parent 062488f commit 198ca98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arches/app/models/models.py
Original file line number Diff line number Diff line change
@@ -616,7 +616,8 @@ def save(self, *args, **kwargs):
@classmethod
def check(cls, **kwargs):
errors = super().check(**kwargs)
errors.extend(cls._check_publication_in_every_language())
if kwargs["databases"]:
errors.extend(cls._check_publication_in_every_language())
return errors

@classmethod
@@ -789,7 +790,8 @@ class Meta:
@classmethod
def check(cls, **kwargs):
errors = super().check(**kwargs)
errors.extend(cls._check_root_node())
if kwargs["databases"]:
errors.extend(cls._check_root_node())
return errors

@classmethod

0 comments on commit 198ca98

Please sign in to comment.