Skip to content

Commit c55f9b4

Browse files
committed
fix: correct semgrep suppression placement
1 parent 50c2638 commit c55f9b4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

spp_api_v2_simulation/routers/scenario.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,11 @@ async def convert_to_program(
532532

533533
# Check for duplicate program name
534534
program_name = request.name or scenario.name
535-
existing = env["spp.program"].sudo().search([("name", "=", program_name)], limit=1) # nosemgrep: odoo-sudo-without-context
535+
existing = (
536+
env["spp.program"] # nosemgrep: odoo-sudo-without-context
537+
.sudo()
538+
.search([("name", "=", program_name)], limit=1)
539+
)
536540
if existing:
537541
raise HTTPException(
538542
status_code=status.HTTP_409_CONFLICT,

spp_api_v2_simulation/services/aggregation_api_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def list_dimensions(self, applies_to=None):
124124
list[dict]: List of dimension info dicts
125125
"""
126126
dimensions = (
127-
self.env["spp.demographic.dimension"]
128-
.sudo() # nosemgrep: odoo-sudo-without-context
127+
self.env["spp.demographic.dimension"] # nosemgrep: odoo-sudo-without-context
128+
.sudo()
129129
.get_active_dimensions(
130130
applies_to=applies_to,
131131
)

spp_api_v2_simulation/services/simulation_api_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def list_templates(self):
2828
list[dict]: List of template info dicts
2929
"""
3030
templates = (
31-
self.env["spp.simulation.scenario.template"]
32-
.sudo() # nosemgrep: odoo-sudo-without-context
31+
self.env["spp.simulation.scenario.template"] # nosemgrep: odoo-sudo-without-context
32+
.sudo()
3333
.search(
3434
[("active", "=", True)],
3535
order="sequence, name",

0 commit comments

Comments
 (0)