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:
parent
a21825fb4b
commit
9b81fa5b4b
@ -43,7 +43,7 @@ First written: 2020/8/8
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</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 %}
|
{% csrf_token %}
|
||||||
<input id="all-account-url" type="hidden" value="{% url "accounting:api.accounts" %}" />
|
<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 %}" />
|
<input id="account-code-original" type="hidden" value="{% if request.resolver_match.kwargs.account %}{{ request.resolver_match.kwargs.account.code }}{% endif %}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user