From: Guillaume Pellerin Date: Tue, 18 Oct 2022 06:37:32 +0000 (+0200) Subject: fix remote field X-Git-Tag: 2.8.1-pro~66^2^2^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4073efa22c1e9e650ac8be8f35a2e75601d9abd5;p=teleforma.git fix remote field --- 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():