style(cloud): reformat modules and restore except-tuple parentheses
Tests / Test failed: 4, passed: 744
Tests / Test failed: 4, passed: 744
Apply consistent line-length formatting across governance, plugins, the SDK routers (governance_api, user_api), user_auth, and migrations 0003/0005/0006. Also restore the parentheses on two except clauses that had been dropped into invalid Python 3 `except A, B:` syntax: plugins._coerce_to_manifest (KeyError, ValueError) and PasswordHasher.verify (InvalidHashError, VerificationError). Both modules now import cleanly again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,8 +91,7 @@ def enforce_user_submission_policy(
|
||||
if not policy.submission_enabled:
|
||||
raise TaskSubmissionPolicyError("task submission is disabled for this user")
|
||||
restricted = (
|
||||
policy.allowed_host_ids is not None
|
||||
or policy.allowed_device_targets is not None
|
||||
policy.allowed_host_ids is not None or policy.allowed_device_targets is not None
|
||||
)
|
||||
if not restricted:
|
||||
return
|
||||
@@ -104,8 +103,12 @@ def enforce_user_submission_policy(
|
||||
):
|
||||
raise TaskSubmissionPolicyError("target host is not permitted")
|
||||
if policy.allowed_device_targets is not None:
|
||||
if target_device_id is None or (
|
||||
target_host_id,
|
||||
target_device_id,
|
||||
) not in policy.allowed_device_targets:
|
||||
if (
|
||||
target_device_id is None
|
||||
or (
|
||||
target_host_id,
|
||||
target_device_id,
|
||||
)
|
||||
not in policy.allowed_device_targets
|
||||
):
|
||||
raise TaskSubmissionPolicyError("target device is not permitted")
|
||||
|
||||
Reference in New Issue
Block a user