diff --git a/groups.py b/groups.py index 6845b88da..e07336e08 100644 --- a/groups.py +++ b/groups.py @@ -519,7 +519,7 @@ def validate_data(ctx, data, allow_update): can_add_category = user.is_member_of(ctx, 'priv-category-add') is_admin = user.is_admin(ctx) - for (category, subcategory, groupname, managers, members, viewers, _, _) in data: + for (category, subcategory, groupname, _managers, _members, _viewers, _schema_id, _expiration_date) in data: if group.exists(ctx, groupname) and not allow_update: errors.append('Group "{}" already exists'.format(groupname)) @@ -739,7 +739,7 @@ def provisionExternalUser(ctx, username, creatorUser, creatorZone): eus_api_secret}, timeout=10, verify=eus_api_tls_verify) - except requests.ConnectionError or requests.ConnectTimeout: + except (requests.ConnectionError, requests.ConnectTimeout): return -1 return response.status_code diff --git a/revisions.py b/revisions.py index 321d5307b..ad3334d4d 100644 --- a/revisions.py +++ b/revisions.py @@ -81,7 +81,7 @@ def api_revisions_search_on_filename(ctx, searchString, offset=0, limit=10): "AND META_DATA_ATTR_VALUE = '" + rev_data['main_original_dataname'] + "' ", # *originalDataName genquery.AS_DICT, ctx) - for row in iter: + for _row in iter: # Data is collected on the basis of ORG_COLL_NAME, duplicates can be present try: # This is a double entry and has to be corrected in the total returned to the frontend @@ -468,7 +468,7 @@ def remove_revision_error_flag(ctx, data_id, path, errorattr): "DATA_ID = '{}' AND META_DATA_ATTR_NAME = '{}' AND META_DATA_ATTR_VALUE = 'true'".format(data_id, errorattr), genquery.AS_LIST, ctx ) - for row in iter2: + for _row in iter2: # Only try to remove it if we know for sure it exists, # otherwise we get useless errors in the log. avu.rmw_from_data(ctx, path, errorattr, "%") @@ -867,7 +867,7 @@ def get_original_exists_dict(ctx, revision_data): """ result = dict() for data_object_data in revision_data: - for (data_id, timestamp, revision_path) in data_object_data: + for (_data_id, _timestamp, revision_path) in data_object_data: try: result[revision_path] = versioned_data_object_exists(ctx, revision_path) diff --git a/schema_transformations.py b/schema_transformations.py index e2b57098f..af6d14ebb 100644 --- a/schema_transformations.py +++ b/schema_transformations.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """JSON schema transformation functions.""" -__copyright__ = 'Copyright (c) 2019-2023, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re @@ -581,13 +581,13 @@ def _hptlab0_hptlab1(ctx, m): try: for item_search in m[attribute]: found = False - for i, elem in enumerate(reference_list): + for _i, elem in enumerate(reference_list): if item_search.lower() in elem.lower(): found = True new_list.append(elem) break if not found: - for i, elem in enumerate(reference_list): + for _i, elem in enumerate(reference_list): # Split on ' ' an compare based on the first token if item_search.split(' ')[0].lower() in elem.lower(): found = True @@ -641,13 +641,13 @@ def _teclab0_teclab1(ctx, m): try: for item_search in m[attribute]: found = False - for i, elem in enumerate(reference_list): + for _i, elem in enumerate(reference_list): if item_search.lower() in elem.lower(): found = True new_list.append(elem) break if not found: - for i, elem in enumerate(reference_list): + for _i, elem in enumerate(reference_list): # Split on ' ' an compare based on the first token if item_search.split(' ')[0].lower() in elem.lower(): found = True diff --git a/vault_archive.py b/vault_archive.py index d52da9edd..4794b1b1f 100644 --- a/vault_archive.py +++ b/vault_archive.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Functions to archive vault data packages.""" -__copyright__ = 'Copyright (c) 2023, Utrecht University' +__copyright__ = 'Copyright (c) 2023-2024, Utrecht University' __license__ = 'GPLv3, see LICENSE' import json @@ -87,10 +87,10 @@ def vault_archivable(ctx, coll): return True if not coll.endswith("/original"): - for row in genquery.row_iterator("META_COLL_ATTR_VALUE", - "META_COLL_ATTR_NAME = 'org_vault_status' AND COLL_NAME = '{}'".format(coll), - genquery.AS_LIST, - ctx): + for _row in genquery.row_iterator("META_COLL_ATTR_VALUE", + "META_COLL_ATTR_NAME = 'org_vault_status' AND COLL_NAME = '{}'".format(coll), + genquery.AS_LIST, + ctx): coll_size = collection.size(ctx, coll) # Data package size is inside archive limits. diff --git a/vault_download.py b/vault_download.py index d443127ac..3e180135b 100644 --- a/vault_download.py +++ b/vault_download.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Functions to download vault data packages.""" -__copyright__ = 'Copyright (c) 2023, Utrecht University' +__copyright__ = 'Copyright (c) 2023-2024, Utrecht University' __license__ = 'GPLv3, see LICENSE' import genquery @@ -18,15 +18,16 @@ def vault_downloadable(ctx, coll): if coll.endswith("/original"): return False - for row in genquery.row_iterator("DATA_SIZE", - "COLL_NAME = '{}' AND DATA_NAME = 'download.zip'".format(coll), - genquery.AS_LIST, - ctx): + + for _row in genquery.row_iterator("DATA_SIZE", + "COLL_NAME = '{}' AND DATA_NAME = 'download.zip'".format(coll), + genquery.AS_LIST, + ctx): return False - for row in genquery.row_iterator("META_COLL_ATTR_VALUE", - "META_COLL_ATTR_NAME = 'org_vault_status' AND COLL_NAME = '{}'".format(coll), - genquery.AS_LIST, - ctx): + for _row in genquery.row_iterator("META_COLL_ATTR_VALUE", + "META_COLL_ATTR_NAME = 'org_vault_status' AND COLL_NAME = '{}'".format(coll), + genquery.AS_LIST, + ctx): return True return False