From dc7ea4ca455ad36ba63ec33f5b7a23c7eac99cc7 Mon Sep 17 00:00:00 2001 From: Horilla Date: Thu, 28 Nov 2024 10:17:26 +0530 Subject: [PATCH] [UPDT] ASSET: Asset request approve operation from detailed view modal --- asset/templates/request_allocation/individual_request.html | 2 +- base/templates/base/action_type/action_type_form.html | 2 +- base/views.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/asset/templates/request_allocation/individual_request.html b/asset/templates/request_allocation/individual_request.html index 0119b9065..8dc3d66ce 100644 --- a/asset/templates/request_allocation/individual_request.html +++ b/asset/templates/request_allocation/individual_request.html @@ -112,7 +112,7 @@ data-toggle="oh-modal-toggle" data-target="#objectCreateModal" hx-get="{% url 'asset-request-approve' req_id=asset_request.id %}" - hx-target="##objectDetailsModalW25Target" + hx-target="#objectCreateModalTarget" > {% trans 'Approve' %} diff --git a/base/templates/base/action_type/action_type_form.html b/base/templates/base/action_type/action_type_form.html index 7bdc5c4a1..987ddd057 100644 --- a/base/templates/base/action_type/action_type_form.html +++ b/base/templates/base/action_type/action_type_form.html @@ -25,7 +25,7 @@ hx-post="{% url 'action-type-update' act_id %}" hx-target="#objectUpdateModalTarget" {% else %} - hx-post="{% url 'action-type-create' %}?dynamic={{dynamic}}&{{hx_vals}}" + hx-post="{% url 'action-type-create' %}?{{pd}}" hx-target="#objectCreateModalTarget" {% endif %} class="oh-profile-section" diff --git a/base/views.py b/base/views.py index cfe922a15..e6f4a8641 100644 --- a/base/views.py +++ b/base/views.py @@ -6025,8 +6025,8 @@ def action_type_create(request): This method renders form and template to create Action Type """ form = ActiontypeForm() + previous_data = request.GET.urlencode() dynamic = request.GET.get("dynamic") - hx_vals = request.GET.get("data") if request.method == "POST": form = ActiontypeForm(request.POST) if form.is_valid(): @@ -6045,8 +6045,7 @@ def action_type_create(request): "base/action_type/action_type_form.html", { "form": form, - "dynamic": dynamic, - "hx_vals": hx_vals, + "pd": previous_data, }, )