From 000403ec96af9ac0c114715c3cef4cdbd300dbc0 Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Thu, 1 Aug 2024 14:32:28 +0200 Subject: [PATCH] PEP8: fix tests for membership --- datarequest.py | 2 +- deposit.py | 2 +- vault.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datarequest.py b/datarequest.py index 76ba69a3a..9b5165d04 100644 --- a/datarequest.py +++ b/datarequest.py @@ -889,7 +889,7 @@ def file_write_and_lock(ctx, coll_path, filename, data, readers): msi.set_acl(ctx, "default", "read", reader, file_path) # Revoke temporary write permission (unless read permissions were set on the invoking user) - if not user.full_name(ctx) in readers: + if user.full_name(ctx) not in readers: msi.set_acl(ctx, "default", "null", user.full_name(ctx), file_path) # If invoking user is request owner, set read permission for this user on the collection again, # else revoke individual user permissions on collection entirely (invoking users will still have diff --git a/deposit.py b/deposit.py index 483cff9e6..fd2596762 100644 --- a/deposit.py +++ b/deposit.py @@ -70,7 +70,7 @@ def api_deposit_copy_data_package(ctx, reference, deposit_group): # Check if user has write access to research folder. # Only normal user has write access. - if not groups.user_role(ctx, user_full_name, group_name) in ['normal', 'manager']: + if groups.user_role(ctx, user_full_name, group_name) not in ['normal', 'manager']: return api.Error('NoWriteAccessTargetCollection', 'Not permitted to write in selected folder') # Register to delayed rule queue. diff --git a/vault.py b/vault.py index ef49617e5..505fcf17f 100644 --- a/vault.py +++ b/vault.py @@ -225,7 +225,7 @@ def api_vault_copy_to_research(ctx, coll_origin, coll_target): # Check if user has write access to research folder. # Only normal user has write access. - if not groups.user_role(ctx, user_full_name, group_name) in ['normal', 'manager']: + if groups.user_role(ctx, user_full_name, group_name) not in ['normal', 'manager']: return api.Error('NoWriteAccessTargetCollection', 'Not permitted to write in selected folder') # Register to delayed rule queue.