From 13173914c9d3608b325bc0eecabc6d217ba0f2f0 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 18 Oct 2022 08:30:41 +0200 Subject: [PATCH] fix remote_field --- teleforma/management/commands/teleforma-copy-seminars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teleforma/management/commands/teleforma-copy-seminars.py b/teleforma/management/commands/teleforma-copy-seminars.py index fc2029f4..f31284a7 100644 --- a/teleforma/management/commands/teleforma-copy-seminars.py +++ b/teleforma/management/commands/teleforma-copy-seminars.py @@ -78,7 +78,7 @@ class Command(BaseCommand): for field in seminar._meta.many_to_many: - if field.rel.to == Document: + if field.remote_field.to == Document: source = getattr(seminar, field.attname) destination = getattr(clone, field.attname) for item in source.all(): @@ -92,7 +92,7 @@ class Command(BaseCommand): destination.add(item_clone) # print ("media cloned and assigned:", item_clone) - elif field.rel.to == Media: + elif field.remote_field.to == Media: source = getattr(seminar, field.attname) destination = getattr(clone, field.attname) for item in source.all(): -- 2.39.5