mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Prefer shorter URL
Flask will pick the first route that matches. Decorators get applied from innermost to outermost. So if the same endpoint is served at `/abc` and `/123` the one used when `url_for` is generating a URL is whichever decorator is lowest (in terms of line number). It doesn’t functionally make a difference, but it’s causing the functional tests to fail at the moment. And shorter URLs are nicer, so I think it makes sense to change here, rather than change the tests.
This commit is contained in:
@@ -105,8 +105,8 @@ def start_tour(service_id, template_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<uuid:service_id>/templates", methods=['GET', 'POST'])
|
||||
@main.route("/services/<uuid:service_id>/templates/all", methods=['GET', 'POST'])
|
||||
@main.route("/services/<uuid:service_id>/templates", methods=['GET', 'POST'])
|
||||
@main.route("/services/<uuid:service_id>/templates/folders/<uuid:template_folder_id>", methods=['GET', 'POST'])
|
||||
@main.route("/services/<uuid:service_id>/templates/<template_type:template_type>", methods=['GET', 'POST'])
|
||||
@main.route("/services/<uuid:service_id>/templates/all/folders/<uuid:template_folder_id>", methods=['GET', 'POST'])
|
||||
|
||||
Reference in New Issue
Block a user