[FIX] HORILLA_VIEWS: Fixed search_url parsing when no search_url is provided
This commit is contained in:
@@ -2200,15 +2200,17 @@ class HorillaNavView(TemplateView):
|
||||
|
||||
context["view_types"] = self.view_types
|
||||
|
||||
# Update search URL with query parameters
|
||||
parsed_search = urlparse(str(self.search_url))
|
||||
parsed_search_url = dict(parse_qsl(parsed_search.query))
|
||||
# parsed_search_url.update(self.request.GET)
|
||||
parsed_search_url.update(extra_params)
|
||||
if self.search_url:
|
||||
# Update search URL with query parameters
|
||||
parsed_search = urlparse(str(self.search_url))
|
||||
parsed_search_url = dict(parse_qsl(parsed_search.query))
|
||||
# parsed_search_url.update(self.request.GET)
|
||||
parsed_search_url.update(extra_params)
|
||||
|
||||
context["search_url"] = urlunparse(
|
||||
parsed_search._replace(query=urlencode(parsed_search_url))
|
||||
)
|
||||
|
||||
context["search_url"] = urlunparse(
|
||||
parsed_search._replace(query=urlencode(parsed_search_url))
|
||||
)
|
||||
# CACHE.get(self.request.session.session_key + "cbv")[HorillaNavView] = context
|
||||
return context
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="oh-modal__dialog-body">
|
||||
<form
|
||||
method="post"
|
||||
action="/{{export_path}}"
|
||||
action="{{export_path}}"
|
||||
onsubmit="
|
||||
const selectedFields = $('#{{view_id|safe}} input[name=selected_fields]:checked').map(function() {
|
||||
return [[$(this).attr('data-label'),this.value]];
|
||||
@@ -88,6 +88,12 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<input type="text" hidden name="export_fields" value="{{export_fields}}">
|
||||
<label class="oh-label" style="color:hsl(8deg 76.82% 46.12%);">
|
||||
{% trans "File name:" %}
|
||||
<br>
|
||||
<input type="text" class="oh-input" required name="export_file_name" value="{{view.export_file_name}}">
|
||||
</label>
|
||||
{% for col in export_fields %}
|
||||
<div class="col-sm-12 col-md-6 col-lg-4">
|
||||
<div class="oh-input-group">
|
||||
|
||||
Reference in New Issue
Block a user