Skip M2M relations in the field list when copying pages - fixes #1852

pull/1879/head
Matt Westcott 2015-10-29 12:10:46 +00:00
rodzic 865ee4aab0
commit cd168a2b41
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -739,6 +739,11 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
if field.auto_created:
continue
# Ignore m2m relations - they will be copied as child objects
# if modelcluster supports them at all (as it does for tags)
if field.many_to_many:
continue
# Ignore parent links (page_ptr)
if isinstance(field, models.OneToOneField) and field.parent_link:
continue