Pass account ID to trade CRUD helper

master
Mark Veidemanis 1 year ago
parent 633894ae75
commit cd89b11611
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -10,7 +10,7 @@
{% for trade_id in item %}
<button
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-target="#modals-here"
hx-swap="innerHTML"

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

Loading…
Cancel
Save