Skip to content

Commit

Permalink
fix(management): add history_type to relations
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Apr 17, 2024
1 parent cb6532f commit 9b5ee2e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def import_relations():
tt._history_date = timestamp
revision_user, _ = User.objects.get_or_create(username=revision["user"])
tt.save()
tt.history.filter(history_date=timestamp).update(history_type="+")
if revision_user:
tt.history.filter(history_date=timestamp).update(history_user=revision_user.id)
except Exception as e:
Expand All @@ -146,5 +147,6 @@ class Command(BaseCommand):
help = "Import relation data from legacy APIS instance"

def handle(self, *args, **options):
fetch_relations()
if not relation_file.exists():
fetch_relations()
import_relations()

0 comments on commit 9b5ee2e

Please sign in to comment.