diff --git a/src/accounting/account/views.py b/src/accounting/account/views.py index 96e9e2f..04a9b7b 100644 --- a/src/accounting/account/views.py +++ b/src/accounting/account/views.py @@ -53,7 +53,7 @@ def list_accounts() -> str: list=pagination.list, pagination=pagination) -@bp.get("/create", endpoint="create") +@bp.get("create", endpoint="create") @has_permission(can_edit) def show_add_account_form() -> str: """Shows the form to add an account. @@ -70,7 +70,7 @@ def show_add_account_form() -> str: form=form) -@bp.post("/store", endpoint="store") +@bp.post("store", endpoint="store") @has_permission(can_edit) def add_account() -> redirect: """Adds an account. @@ -91,7 +91,7 @@ def add_account() -> redirect: return redirect(inherit_next(__get_detail_uri(account))) -@bp.get("/", endpoint="detail") +@bp.get("", endpoint="detail") @has_permission(can_view) def show_account_detail(account: Account) -> str: """Shows the account detail. @@ -102,7 +102,7 @@ def show_account_detail(account: Account) -> str: return render_template("accounting/account/detail.html", obj=account) -@bp.get("//edit", endpoint="edit") +@bp.get("/edit", endpoint="edit") @has_permission(can_edit) def show_account_edit_form(account: Account) -> str: """Shows the form to edit an account. @@ -121,7 +121,7 @@ def show_account_edit_form(account: Account) -> str: account=account, form=form) -@bp.post("//update", endpoint="update") +@bp.post("/update", endpoint="update") @has_permission(can_edit) def update_account(account: Account) -> redirect: """Updates an account. @@ -148,7 +148,7 @@ def update_account(account: Account) -> redirect: return redirect(inherit_next(__get_detail_uri(account))) -@bp.post("//delete", endpoint="delete") +@bp.post("/delete", endpoint="delete") @has_permission(can_edit) def delete_account(account: Account) -> redirect: """Deletes an account. @@ -167,7 +167,7 @@ def delete_account(account: Account) -> redirect: return redirect(or_next(__get_list_uri())) -@bp.get("/bases/", endpoint="order") +@bp.get("bases/", endpoint="order") @has_permission(can_view) def show_account_order(base: BaseAccount) -> str: """Shows the order of the accounts under a same base account. @@ -178,7 +178,7 @@ def show_account_order(base: BaseAccount) -> str: return render_template("accounting/account/order.html", base=base) -@bp.post("/bases/", endpoint="sort") +@bp.post("bases/", endpoint="sort") @has_permission(can_edit) def sort_accounts(base: BaseAccount) -> redirect: """Reorders the accounts under a base account. diff --git a/src/accounting/base_account/views.py b/src/accounting/base_account/views.py index 14d0dd0..fc43f9a 100644 --- a/src/accounting/base_account/views.py +++ b/src/accounting/base_account/views.py @@ -41,7 +41,7 @@ def list_accounts() -> str: list=pagination.list, pagination=pagination) -@bp.get("/", endpoint="detail") +@bp.get("", endpoint="detail") @has_permission(can_view) def show_account_detail(account: BaseAccount) -> str: """Shows the account detail. diff --git a/src/accounting/currency/views.py b/src/accounting/currency/views.py index 98b44a1..685ac7c 100644 --- a/src/accounting/currency/views.py +++ b/src/accounting/currency/views.py @@ -55,7 +55,7 @@ def list_currencies() -> str: list=pagination.list, pagination=pagination) -@bp.get("/create", endpoint="create") +@bp.get("create", endpoint="create") @has_permission(can_edit) def show_add_currency_form() -> str: """Shows the form to add a currency. @@ -72,7 +72,7 @@ def show_add_currency_form() -> str: form=form) -@bp.post("/store", endpoint="store") +@bp.post("store", endpoint="store") @has_permission(can_edit) def add_currency() -> redirect: """Adds a currency. @@ -93,7 +93,7 @@ def add_currency() -> redirect: return redirect(inherit_next(__get_detail_uri(currency))) -@bp.get("/", endpoint="detail") +@bp.get("", endpoint="detail") @has_permission(can_view) def show_currency_detail(currency: Currency) -> str: """Shows the currency detail. @@ -104,7 +104,7 @@ def show_currency_detail(currency: Currency) -> str: return render_template("accounting/currency/detail.html", obj=currency) -@bp.get("//edit", endpoint="edit") +@bp.get("/edit", endpoint="edit") @has_permission(can_edit) def show_currency_edit_form(currency: Currency) -> str: """Shows the form to edit a currency. @@ -123,7 +123,7 @@ def show_currency_edit_form(currency: Currency) -> str: currency=currency, form=form) -@bp.post("//update", endpoint="update") +@bp.post("/update", endpoint="update") @has_permission(can_edit) def update_currency(currency: Currency) -> redirect: """Updates a currency. @@ -151,7 +151,7 @@ def update_currency(currency: Currency) -> redirect: return redirect(inherit_next(__get_detail_uri(currency))) -@bp.post("//delete", endpoint="delete") +@bp.post("/delete", endpoint="delete") @has_permission(can_edit) def delete_currency(currency: Currency) -> redirect: """Deletes a currency. @@ -169,7 +169,7 @@ def delete_currency(currency: Currency) -> redirect: return redirect(or_next(url_for("accounting.currency.list"))) -@api_bp.get("/exists-code", endpoint="exists") +@api_bp.get("exists-code", endpoint="exists") @has_permission(can_edit) def exists_code() -> dict[str, bool]: """Validates whether a currency code exists. diff --git a/src/accounting/journal_entry/views.py b/src/accounting/journal_entry/views.py index f061ef3..a0988e4 100644 --- a/src/accounting/journal_entry/views.py +++ b/src/accounting/journal_entry/views.py @@ -49,7 +49,7 @@ bp.add_app_template_filter(format_amount_input, bp.add_app_template_filter(text2html, "accounting_journal_entry_text2html") -@bp.get("/create/", endpoint="create") +@bp.get("create/", endpoint="create") @has_permission(can_edit) def show_add_journal_entry_form(journal_entry_type: JournalEntryType) -> str: """Shows the form to add a journal entry. @@ -71,7 +71,7 @@ def show_add_journal_entry_form(journal_entry_type: JournalEntryType) -> str: return journal_entry_op.render_create_template(form) -@bp.post("/store/", endpoint="store") +@bp.post("store/", endpoint="store") @has_permission(can_edit) def add_journal_entry(journal_entry_type: JournalEntryType) -> redirect: """Adds a journal entry. @@ -98,7 +98,7 @@ def add_journal_entry(journal_entry_type: JournalEntryType) -> redirect: return redirect(inherit_next(__get_detail_uri(journal_entry))) -@bp.get("/", endpoint="detail") +@bp.get("", endpoint="detail") @has_permission(can_view) def show_journal_entry_detail(journal_entry: JournalEntry) -> str: """Shows the journal entry detail. @@ -111,7 +111,7 @@ def show_journal_entry_detail(journal_entry: JournalEntry) -> str: return journal_entry_op.render_detail_template(journal_entry) -@bp.get("//edit", endpoint="edit") +@bp.get("/edit", endpoint="edit") @has_permission(can_edit) def show_journal_entry_edit_form(journal_entry: JournalEntry) -> str: """Shows the form to edit a journal entry. @@ -133,7 +133,7 @@ def show_journal_entry_edit_form(journal_entry: JournalEntry) -> str: return journal_entry_op.render_edit_template(journal_entry, form) -@bp.post("//update", endpoint="update") +@bp.post("/update", endpoint="update") @has_permission(can_edit) def update_journal_entry(journal_entry: JournalEntry) -> redirect: """Updates a journal entry. @@ -166,7 +166,7 @@ def update_journal_entry(journal_entry: JournalEntry) -> redirect: return redirect(inherit_next(__get_detail_uri(journal_entry))) -@bp.post("//delete", endpoint="delete") +@bp.post("/delete", endpoint="delete") @has_permission(can_edit) def delete_journal_entry(journal_entry: JournalEntry) -> redirect: """Deletes a journal entry. @@ -186,7 +186,7 @@ def delete_journal_entry(journal_entry: JournalEntry) -> redirect: return redirect(or_next(__get_default_page_uri())) -@bp.get("/dates/", endpoint="order") +@bp.get("dates/", endpoint="order") @has_permission(can_view) def show_journal_entry_order(journal_entry_date: date) -> str: """Shows the order of the journal entries in a same date. @@ -201,7 +201,7 @@ def show_journal_entry_order(journal_entry_date: date) -> str: date=journal_entry_date, list=journal_entries) -@bp.post("/dates/", endpoint="sort") +@bp.post("dates/", endpoint="sort") @has_permission(can_edit) def sort_journal_entries(journal_entry_date: date) -> redirect: """Reorders the journal entries in a date.