mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 17:36:49 +01:00
Split out a method for getting json_data to pass to chooser view
This commit is contained in:
parent
b301fb17a7
commit
16ea847aca
@ -244,6 +244,11 @@ class ChooseViewMixin:
|
||||
|
||||
return context
|
||||
|
||||
def get_response_json_data(self):
|
||||
return {
|
||||
"step": "choose",
|
||||
}
|
||||
|
||||
# Return the choose view as a ModalWorkflow response
|
||||
def render_to_response(self):
|
||||
return render_modal_workflow(
|
||||
@ -251,9 +256,7 @@ class ChooseViewMixin:
|
||||
self.template_name,
|
||||
None,
|
||||
self.get_context_data(),
|
||||
json_data={
|
||||
"step": "choose",
|
||||
},
|
||||
json_data=self.get_response_json_data(),
|
||||
)
|
||||
|
||||
|
||||
|
@ -220,16 +220,19 @@ class DocumentChooseViewMixin:
|
||||
)
|
||||
return context
|
||||
|
||||
def get_response_json_data(self):
|
||||
return {
|
||||
"step": "choose",
|
||||
"tag_autocomplete_url": reverse("wagtailadmin_tag_autocomplete"),
|
||||
}
|
||||
|
||||
def render_to_response(self):
|
||||
return render_modal_workflow(
|
||||
self.request,
|
||||
self.template_name,
|
||||
None,
|
||||
self.get_context_data(),
|
||||
json_data={
|
||||
"step": "choose",
|
||||
"tag_autocomplete_url": reverse("wagtailadmin_tag_autocomplete"),
|
||||
},
|
||||
json_data=self.get_response_json_data(),
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user