Skip to content

Commit 80fd940

Browse files
committed
dont change op_id if set explicitly in controller
1 parent ec7673c commit 80fd940

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ninja_extra/controllers/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ def __str__(self) -> str: # pragma: no cover
366366

367367
def _add_operation_from_route_function(self, route_function: RouteFunction) -> None:
368368
# converts route functions to Operation model
369-
route_function.route.route_params.operation_id = f"{str(uuid.uuid4())[:8]}_controller_{route_function.route.view_func.__name__}"
369+
if route_function.route.route_params.operation_id is None:
370+
route_function.route.route_params.operation_id = f"{str(uuid.uuid4())[:8]}_controller_{route_function.route.view_func.__name__}"
370371

371372
if (
372373
self.auth

0 commit comments

Comments
 (0)