✨(backend) allow the duplication of subpages
Adds a new with_descendants parameter to the doc duplication API. The logic of the duplicate() method has been moved to a new internal _duplicate_document() method to allow for recursion. Adds unit tests for the new feature.
This commit is contained in:
@@ -591,10 +591,13 @@ class LinkDocumentSerializer(serializers.ModelSerializer):
|
||||
class DocumentDuplicationSerializer(serializers.Serializer):
|
||||
"""
|
||||
Serializer for duplicating a document.
|
||||
Allows specifying whether to keep access permissions.
|
||||
Allows specifying whether to keep access permissions,
|
||||
and whether to duplicate descendant documents as well
|
||||
(deep copy) or not (shallow copy).
|
||||
"""
|
||||
|
||||
with_accesses = serializers.BooleanField(default=False)
|
||||
with_descendants = serializers.BooleanField(default=False)
|
||||
|
||||
def create(self, validated_data):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user