Page copy method to use exclude_fields_in_copy

pull/4012/head
LB 2017-11-01 19:37:57 +07:00 zatwierdzone przez Matt Westcott
rodzic cd924d0948
commit d31f600714
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -1031,8 +1031,9 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
def copy(self, recursive=False, to=None, update_attrs=None, copy_revisions=True, keep_live=True, user=None):
# Fill dict with self.specific values
exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path']
specific_self = self.specific
default_exclude_fields = ['id', 'path', 'depth', 'numchild', 'url_path', 'path']
exclude_fields = default_exclude_fields + specific_self.exclude_fields_in_copy
specific_dict = {}
for field in specific_self._meta.get_fields():