Skip to content

Commit

Permalink
Ensure migration is only run for XForms that are active
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisRayM committed Feb 23, 2021
1 parent eaa21d5 commit cf3da91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion onadata/apps/logger/migrations/0062_auto_20210202_0248.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ def regenerate_instance_json(apps, schema_editor):
"""
Regenerate Instance JSON
"""
for inst in Instance.objects.filter(deleted_at__isnull=True):
for inst in Instance.objects.filter(
deleted_at__isnull=True,
xform__downloadable=True,
xform__deleted_at__isnull=True):
inst.json = inst.get_full_dict(load_existing=False)
inst.save()

Expand Down

0 comments on commit cf3da91

Please sign in to comment.