Skip to content

Commit

Permalink
Handle no users set test error
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiky30 committed Dec 23, 2021
1 parent 8b646df commit f17df1a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def forwards(apps, schema_editor):

url_queryset = Url.objects.all()

if djangocms_versioning_config_enabled and djangocms_versioning_installed:
# Only set the additional user etc if
# - versioning is enabled
# - there is url data, test suites fail when empty if not
if djangocms_versioning_config_enabled and djangocms_versioning_installed and len(url_queryset):
# Get a migration user.
migration_user = User.objects.get(id=DJANGOCMS_URL_MANAGER_VERSIONING_MIGRATION_USER_ID)
Version = apps.get_model('djangocms_versioning', 'Version')
Expand Down

0 comments on commit f17df1a

Please sign in to comment.