Changed the action URL in template of the account form to the current request URL, to simplify it in the accounting application.

This commit is contained in:
依瑪貓 2020-08-14 08:41:39 +08:00
parent a21825fb4b
commit 9b81fa5b4b

View File

@ -43,7 +43,7 @@ First written: 2020/8/8
</a>
</div>
<form id="account-form" action="{% if request.resolver_match.kwargs.account %}{% url "accounting:accounts.update" request.resolver_match.kwargs.account %}{% else %}{% url "accounting:accounts.create" %}{% endif %}" method="post">
<form id="account-form" action="{{ request.get_full_path }}" method="post">
{% csrf_token %}
<input id="all-account-url" type="hidden" value="{% url "accounting:api.accounts" %}" />
<input id="account-code-original" type="hidden" value="{% if request.resolver_match.kwargs.account %}{{ request.resolver_match.kwargs.account.code }}{% endif %}" />