]> git.parisson.com Git - teleforma.git/commitdiff
fix field parsing
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 17:07:15 +0000 (18:07 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 17:07:15 +0000 (18:07 +0100)
teleforma/management/commands/teleforma-copy-seminars.py

index 888dfade6d248df9ee00eac23a0c773ba526a589..c859f39087863f8d8a7e6d9616475a09c5763333 100644 (file)
@@ -37,7 +37,7 @@ class Command(BaseCommand):
                     print ('dates updated', clone)
 
                     for field in seminar._meta.many_to_many:
-                        if type(field) == Document or type(field) == Media:
+                        if type(field.rel.to) == Document or type(field.rel.to) == Media:
                             source = getattr(seminar, field.attname)
                             destination = getattr(clone, field.attname)
                             for item in source.all():