Combined the create and store URL, and the edit and update URL of the accounts to simplify the URL pattern settings, because they are handled by the same view now in the accounting application.

This commit is contained in:
imacat committed 2020-08-14 00:51:09 +08:00
1 parent 21c9db396d
commit 0398fb609e
4 files changed
+3 -7

No files matched your search

@@ -70,7 +70,7 @@ First written: 2020/8/8
<i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }}
</a>
<a class="btn btn-primary" role="button" href="{% url "accounting:accounts.edit" account %}">
<a class="btn btn-primary" role="button" href="{% url "accounting:accounts.update" account %}">
<i class="fas fa-user-cog"></i>
{{ _("Settings")|force_escape }}
</a>
@@ -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.store" %}{% endif %}" method="post">
<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">
{% 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 %}" />