Pass account ID to trade CRUD helper

This commit is contained in:
Mark Veidemanis 2022-12-08 07:20:46 +00:00
parent 633894ae75
commit cd89b11611
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
{% for trade_id in item %} {% for trade_id in item %}
<button <button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'trade_action' type=type trade_id=trade_id account_id=object.account_id %}" hx-get="{% url 'trade_action' type=type account_id=object.account_id trade_id=trade_id %}"
hx-trigger="click" hx-trigger="click"
hx-target="#modals-here" hx-target="#modals-here"
hx-swap="innerHTML" hx-swap="innerHTML"

View File

@ -25,7 +25,7 @@ class TradeAction(LoginRequiredMixin, OTPRequiredMixin, ObjectRead):
context_object_name = "positions" context_object_name = "positions"
detail_url_name = "trade_action" detail_url_name = "trade_action"
detail_url_args = ["type", "trade_id"] detail_url_args = ["type", "account_id", "trade_id"]
def get_object(self, **kwargs): def get_object(self, **kwargs):
trade_id = kwargs.get("trade_id") trade_id = kwargs.get("trade_id")