mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 01:46:24 +01:00
Skip M2M relations in the field list when copying pages - fixes #1852
This commit is contained in:
parent
865ee4aab0
commit
cd168a2b41
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user