]> git.parisson.com Git - teleforma.git/commitdiff
fix remote_field
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 18 Oct 2022 06:30:41 +0000 (08:30 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 18 Oct 2022 06:30:41 +0000 (08:30 +0200)
teleforma/management/commands/teleforma-copy-seminars.py

index fc2029f4bc9f5ad4cda77288a05b87ec9f898187..f31284a76b1ae312d2c15949b5c82f81ff89f05d 100644 (file)
@@ -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():