Skip to content

Commit

Permalink
fix(helpers): comments and better syntax;
Browse files Browse the repository at this point in the history
- Added in line comments.
- Used shorthand syntax.
  • Loading branch information
JVickery-TBS committed Jan 31, 2024
1 parent 3e3eebf commit 8f8a713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckanext/xloader/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ def xloader_status_description(status):
def is_resource_supported_by_xloader(res_dict, check_access = True):
is_supported_format = XLoaderFormats.is_it_an_xloader_format(res_dict.get('format'))
is_datastore_active = res_dict.get('datastore_active', False)
if check_access:
user_has_access = toolkit.h.check_access('package_update', {'id':res_dict.get('package_id')})
else:
user_has_access = True
user_has_access = not check_access or toolkit.h.check_access('package_update',
{'id':res_dict.get('package_id')})
try:
is_supported_url_type = res_dict.get('url_type') not in toolkit.h.datastore_rw_resource_url_types()
except AttributeError:
Expand Down
1 change: 1 addition & 0 deletions ckanext/xloader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def is_it_an_xloader_format(cls, format_):
if cls.formats is None:
cls._formats = config.get("ckanext.xloader.formats")
if cls._formats is not None:
# use config value. preserves empty list as well.
cls._formats = cls._formats.lower().split()
else:
cls._formats = DEFAULT_FORMATS
Expand Down

0 comments on commit 8f8a713

Please sign in to comment.