0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

rename parent_page_id API parameter to destination_page_id for consistency with other actions

This commit is contained in:
Tidiane Dia 2022-01-07 12:06:05 +00:00 committed by Matt Westcott
parent d05095b4c3
commit d03460a5cc

View File

@ -13,7 +13,7 @@ from .base import APIAction
class CreatePageAliasAPIActionSerializer(Serializer):
parent_page_id = fields.IntegerField(required=False)
destination_page_id = fields.IntegerField(required=False)
recursive = fields.BooleanField(default=False, required=False)
update_slug = fields.CharField(required=False)
update_locale = fields.CharField(required=False)
@ -24,9 +24,9 @@ class CreatePageAliasAPIAction(APIAction):
serializer = CreatePageAliasAPIActionSerializer
def _action_from_data(self, instance, data):
parent, parent_page_id = None, data.get("parent_page_id")
if parent_page_id:
parent = get_object_or_404(Page, id=parent_page_id).specific
parent, destination_page_id = None, data.get("destination_page_id")
if destination_page_id:
parent = get_object_or_404(Page, id=destination_page_id).specific
return CreatePageAliasAction(
page=instance,