Skip to content

Commit f2a1ae0

Browse files
authored
fix: duplicate action slash (#1536)
1 parent 2adbacb commit f2a1ae0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/unfold/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def wrapper(*args, **kwargs):
135135

136136
actions_list_urls = [
137137
path(
138-
action.path,
138+
f"{action.path.removesuffix('/')}/",
139139
wrap(action.method),
140140
name=action.action_name,
141141
)
@@ -144,7 +144,7 @@ def wrapper(*args, **kwargs):
144144

145145
action_detail_urls = [
146146
path(
147-
f"<path:object_id>/{action.path}",
147+
f"<path:object_id>/{action.path.removesuffix('/')}/",
148148
wrap(action.method),
149149
name=action.action_name,
150150
)
@@ -153,7 +153,7 @@ def wrapper(*args, **kwargs):
153153

154154
action_row_urls = [
155155
path(
156-
f"<path:object_id>/{action.path}",
156+
f"<path:object_id>/{action.path.removesuffix('/')}/",
157157
wrap(action.method),
158158
name=action.action_name,
159159
)

0 commit comments

Comments
 (0)