From: Guillaume Pellerin Date: Tue, 18 Oct 2022 06:30:41 +0000 (+0200) Subject: fix remote_field X-Git-Tag: 2.8.1-pro~66^2^2^2~2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=28869f63d7497aa2b24f05c4ed75f0326865e6f7;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 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():