Skip to content

Commit 7d64ec2

Browse files
author
oanatmaria
committed
Fix comments
1 parent 22b840c commit 7d64ec2

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

packages/flask-aserto/src/flask_aserto/aio/check.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,9 @@ async def mapper() -> str:
130130
policy_path = await self._options.policyPathMapper()
131131
if policy_path == "":
132132
policy_path = "check"
133-
if self._options.policyRoot:
134-
policy_path = self._options.policyRoot + "." + policy_path
135-
elif self._aserto_middleware._policy_path_root != "":
136-
policy_path = self._aserto_middleware._policy_path_root + "." + policy_path
133+
policy_root = self._options.policyRoot or self._aserto_middleware._policy_path_root
134+
if policy_root:
135+
policy_path = f"{policy_root}.{policy_path}"
137136
return policy_path
138137

139138
return mapper

packages/flask-aserto/src/flask_aserto/check.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,9 @@ def mapper() -> str:
130130
policy_path = self._options.policyPathMapper()
131131
if policy_path == "":
132132
policy_path = "check"
133-
if self._options.policyRoot:
134-
policy_path = self._options.policyRoot + "." + policy_path
135-
elif self._aserto_middleware._policy_path_root != "":
136-
policy_path = self._aserto_middleware._policy_path_root + "." + policy_path
133+
policy_root = self._options.policyRoot or self._aserto_middleware._policy_path_root
134+
if policy_root:
135+
policy_path = f"{policy_root}.{policy_path}"
137136
return policy_path
138137

139138
return mapper

0 commit comments

Comments
 (0)