Renamed the "journal_entry_date" parameter to "date" in the sort_journal_entries route.

This commit is contained in:
依瑪貓 2023-04-26 13:32:30 +08:00
parent f1351243a6
commit 2986c518ce
2 changed files with 5 additions and 5 deletions

View File

@ -201,16 +201,16 @@ def show_journal_entry_order(journal_entry_date: dt.date) -> str:
date=journal_entry_date, list=journal_entries)
@bp.post("dates/<date:journal_entry_date>", endpoint="sort")
@bp.post("dates/<date:date>", endpoint="sort")
@has_permission(can_edit)
def sort_journal_entries(journal_entry_date: dt.date) -> redirect:
def sort_journal_entries(date: dt.date) -> redirect:
"""Reorders the journal entries in a date.
:param journal_entry_date: The date.
:param date: The date.
:return: The redirection to the incoming account or the account list. The
reordering operation does not fail.
"""
form: JournalEntryReorderForm = JournalEntryReorderForm(journal_entry_date)
form: JournalEntryReorderForm = JournalEntryReorderForm(date)
form.save_order()
if not form.is_modified:
flash(s(lazy_gettext("The order was not modified.")), "success")

View File

@ -38,7 +38,7 @@ First written: 2023/2/26
</div>
{% if list|length > 1 and accounting_can_edit() %}
<form action="{{ url_for("accounting.journal-entry.sort", journal_entry_date=date) }}" method="post">
<form action="{{ url_for("accounting.journal-entry.sort", date=date) }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% if request.args.next %}
<input type="hidden" name="next" value="{{ request.args.next }}">