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

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