mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-28 02:24:48 +00:00
Skip M2M relations in the field list when copying pages - fixes #1852
This commit is contained in:
parent
865ee4aab0
commit
cd168a2b41
1 changed files with 5 additions and 0 deletions
|
|
@ -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 a new issue