File tree Expand file tree Collapse file tree
packages/flask-aserto/src/flask_aserto Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments