From 8776cd19dddc7dc8b20521230960f99887e53d79 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 5 Aug 2022 12:09:32 -0500 Subject: [PATCH] Clean up URL routes for row CRUD --- tailbone/views/master.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index a9e2110f..80af4ca1 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -4870,7 +4870,8 @@ class MasterView(View): # view row if cls.has_rows: if cls.rows_viewable: - config.add_route('{}.view_row'.format(route_prefix), '{}/{{uuid}}/rows/{{row_uuid}}'.format(url_prefix)) + config.add_route('{}.view_row'.format(route_prefix), + '{}/rows/{{row_uuid}}'.format(instance_url_prefix)) config.add_view(cls, attr='view_row', route_name='{}.view_row'.format(route_prefix), permission='{}.view'.format(permission_prefix)) @@ -4880,7 +4881,8 @@ class MasterView(View): config.add_tailbone_permission(permission_prefix, '{}.edit_row'.format(permission_prefix), "Edit individual {}".format(row_model_title_plural)) if cls.rows_editable: - config.add_route('{}.edit_row'.format(route_prefix), '{}/{{uuid}}/rows/{{row_uuid}}/edit'.format(url_prefix)) + config.add_route('{}.edit_row'.format(route_prefix), + '{}/rows/{{row_uuid}}/edit'.format(instance_url_prefix)) config.add_view(cls, attr='edit_row', route_name='{}.edit_row'.format(route_prefix), permission='{}.edit_row'.format(permission_prefix)) @@ -4889,6 +4891,7 @@ class MasterView(View): if cls.rows_deletable: config.add_tailbone_permission(permission_prefix, '{}.delete_row'.format(permission_prefix), "Delete individual {}".format(row_model_title_plural)) - config.add_route('{}.delete_row'.format(route_prefix), '{}/{{uuid}}/rows/{{row_uuid}}/delete'.format(url_prefix)) + config.add_route('{}.delete_row'.format(route_prefix), + '{}/rows/{{row_uuid}}/delete'.format(instance_url_prefix)) config.add_view(cls, attr='delete_row', route_name='{}.delete_row'.format(route_prefix), permission='{}.delete_row'.format(permission_prefix))