Repository: wagtail/wagtail
File: wagtail/admin/views/pages/create.py (Python)

Code before:
            and self.parent_page.has_workflow
        ):
            return self.submit_action()
        else:
            return self.save_action()

    def get_page_subtitle(self):
        return self.page_class.get_verbose_name()

    def get_edit_message_button(self):
        return messages.button(
            reverse("wagtailadmin_pages:edit", args=(self.page.id,)), _("Edit")
        )

    def get_view_draft_message_button(self):
        return messages.button(
            reverse("wagtailadmin_pages:view_draft", args=(self.page.id,)),
            _("View draft"),
            new_window=False,
        )

    def get_view_live_message_button(self):
        return messages.button(self.page.url, _("View live"), new_window=False)

    def set_default_privacy_setting(self):
        # privacy setting options ['public',"logged_in", "shared_password", "user_groups"]
        default_privacy_setting = self.page.get_default_privacy_setting(self.request)

        if (
            default_privacy_setting["type"] == "public"
        ):  # default privacy setting is public no need to do anything
            pass
        elif default_privacy_setting["type"] == "logged_in":
            PageViewRestriction.objects.create(page=self.page, restriction_type="login")
        elif default_privacy_setting["type"] == "shared_password":
            PageViewRestriction.objects.create(
                page=self.page,
                restriction_type="password",
                password=default_privacy_setting["password"],
            )
        elif default_privacy_setting["type"] == "user_groups":
            # Create a page view restriction for groups
            groups_page_restriction = PageViewRestriction.objects.create(
                page=self.page, restriction_type="groups"
            )
            # add groups to the page view restriction
            for group in default_privacy_setting["groups"]:
                groups_page_restriction.groups.add(group)
        else:
            # Not sure which exception should be raised here
            raise Exception(

Review comment (suggestion):
Issue: These should match the existing restriction names (`BaseViewRestriction.RESTRICTION_CHOICES`).

Code after:
            bool(self.request.POST.get("action-publish"))
            and self.parent_page_perms.can_publish_subpage()
        ):
            return self.publish_action()
        elif (
            bool(self.request.POST.get("action-submit"))
            and self.parent_page.has_workflow
        ):
            return self.submit_action()
        else:
            return self.save_action()

    def get_page_subtitle(self):
        return self.page_class.get_verbose_name()

    def get_edit_message_button(self):
        return messages.button(
            reverse("wagtailadmin_pages:edit", args=(self.page.id,)), _("Edit")
        )

    def get_view_draft_message_button(self):
        return messages.button(
            reverse("wagtailadmin_pages:view_draft", args=(self.page.id,)),
            _("View draft"),
            new_window=False,
        )

    def get_view_live_message_button(self):
        return messages.button(self.page.url, _("View live"), new_window=False)

    def set_default_privacy_setting(self):
        # privacy setting options BaseViewRestriction.RESTRICTION_CHOICES
        default_privacy_setting = self.page.get_default_privacy_setting(self.request)

        if default_privacy_setting["type"] == BaseViewRestriction.NONE:
            # default privacy setting is public no need to do anything
            pass
        elif default_privacy_setting["type"] == BaseViewRestriction.LOGIN:
            PageViewRestriction.objects.create(
                page=self.page,
                restriction_type=BaseViewRestriction.LOGIN,
            )
        elif default_privacy_setting["type"] == BaseViewRestriction.PASSWORD:
            PageViewRestriction.objects.create(
                page=self.page,
                restriction_type=BaseViewRestriction.PASSWORD,
                password=default_privacy_setting["password"],
            )
        elif default_privacy_setting["type"] == BaseViewRestriction.GROUPS:
            # Create a page view restriction for groups
            groups_page_restriction = PageViewRestriction.objects.create(