From 4073efa22c1e9e650ac8be8f35a2e75601d9abd5 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 18 Oct 2022 08:37:32 +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 f31284a7..d4a895ce 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.remote_field.to == Document: + if field.remote_field.model == 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.remote_field.to == Media: + elif field.remote_field.model == Media: source = getattr(seminar, field.attname) destination = getattr(clone, field.attname) for item in source.all(): -- 2.39.5