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

Add edit_handler/form_class overrides to Snippets preview and compare views

This commit is contained in:
Sage Abdullah 2023-03-31 13:04:46 +01:00 committed by Matt Westcott
parent ecfafa595a
commit 5ae3b444da

View File

@ -951,6 +951,7 @@ class SnippetViewSet(ModelViewSet):
def revisions_compare_view(self):
return self.revisions_compare_view_class.as_view(
model=self.model,
edit_handler=self._edit_handler,
template_name=self.get_templates(
"revisions_compare",
fallback=self.revisions_compare_view_class.template_name,
@ -993,11 +994,17 @@ class SnippetViewSet(ModelViewSet):
@property
def preview_on_add_view(self):
return self.preview_on_add_view_class.as_view(model=self.model)
return self.preview_on_add_view_class.as_view(
model=self.model,
form_class=self.get_form_class(),
)
@property
def preview_on_edit_view(self):
return self.preview_on_edit_view_class.as_view(model=self.model)
return self.preview_on_edit_view_class.as_view(
model=self.model,
form_class=self.get_form_class(),
)
@property
def lock_view(self):