Skip to content

Commit

Permalink
Comment out unnecessary log information used for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
NTaherifar committed Sep 19, 2024
1 parent 3fa6cc0 commit 18bfbb9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def organization_list_for_user(next_action, context, data_dict):
@tk.chained_action
def package_create(next_action, context, data_dict):
logger = logging.getLogger(__name__)
logger.info("package_create before data_dict: %s", pformat(data_dict))
# logger.info("package_create before data_dict: %s", pformat(data_dict))

package_type = data_dict.get('type')
package_plugin = lib_plugins.lookup_package_plugin(package_type)
Expand Down Expand Up @@ -86,7 +86,7 @@ def package_create(next_action, context, data_dict):
data_dict['acquisition_end_date'] = acquisition_end_date


logger.info("package_create after data_dict: %s", pformat(data_dict))
# logger.info("package_create after data_dict: %s", pformat(data_dict))

return next_action(context, data_dict)

Expand Down Expand Up @@ -310,7 +310,7 @@ def organization_member_create(next_action, context, data_dict):
logger = logging.getLogger(__name__)
member = None
try:
logger.info("Adding member to collection: %s", data_dict)
# logger.info("Adding member to collection: %s", data_dict)
member = next_action(context, data_dict)
except tk.ValidationError as e:
logger.error(f'Error during member addition: {e.error_dict}')
Expand All @@ -328,7 +328,7 @@ def organization_create(next_action, context, data_dict):
logger = logging.getLogger(__name__)
collection = None
try:
logger.info("Creating organization: %s", pformat(data_dict))
# logger.info("Creating organization: %s", pformat(data_dict))
collection = next_action(context, data_dict)
except tk.ValidationError as e:
logger.error(f'Error during collection creation: {e.error_dict}')
Expand All @@ -353,11 +353,11 @@ def organization_delete(next_action, context, data_dict):
logger = logging.getLogger(__name__)
collection = None
try:
logger.info("Deleting collection: %s", pformat(data_dict))
# logger.info("Deleting collection: %s", pformat(data_dict))

org_id = tk.get_or_bust(data_dict, 'id')
organization = get_action('organization_show')({}, {'id': org_id})
logger.info(f'Collection deletion result: %s', pformat(organization))
# logger.info(f'Collection deletion result: %s', pformat(organization))
if not organization:
raise tk.ObjectNotFound('Collection was not found.')
members=organization.get('users')
Expand Down
12 changes: 6 additions & 6 deletions ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ def package_show(next_auth, context, data_dict):
user = context.get('auth_user_obj')

logger = logging.getLogger(__name__)
logger.info('Entering package_show auth override')
# logger.info('Entering package_show auth override')

if package:
logger.info(f'Package {package_id} found, private: {package.private}')
# logger.info(f'Package {package_id} found, private: {package.private}')
if not package.private:
return {'success': True}

if user:
logger.info(f'User {user.name} with ID {user.id} is attempting to access package {package_id}')
else:
logger.info(f'Anonymous user is attempting to access package {package_id}')
# if user:
# logger.info(f'User {user.name} with ID {user.id} is attempting to access package {package_id}')
# else:
# logger.info(f'Anonymous user is attempting to access package {package_id}')

if package and package.owner_org:
user_role = authz.users_role_for_group_or_org(package.owner_org, user.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,29 @@ def set_parent_sample(context):
created_samples = session.get('created_samples', [])
log = logging.getLogger(__name__)
for sample in samples:
log.info(f"set_parent_sample sample : {sample}")
# log.info(f"set_parent_sample sample : {sample}")

parent_sample = sample.get('parent_sample')
if not parent_sample:
continue

log.info(f"set_parent_sample parent_sample : {parent_sample}")
# log.info(f"set_parent_sample parent_sample : {parent_sample}")

# Attempt to find the parent sample by DOI or sample number
parent_package = find_parent_package(parent_sample, context, samples, created_samples)
if not parent_package:
continue

log.info(f"parent_package : {parent_package}")
# log.info(f"parent_package : {parent_package}")

# Update the sample with the parent sample ID
sample_id = get_created_sample_id(sample)
log.info(f"sample_id : {sample_id}")
# log.info(f"sample_id : {sample_id}")

if 'id' not in parent_package:
parent_package['id'] = get_created_sample_id(parent_package)

log.info(f"parent_package['id'] : {parent_package['id']}")
# log.info(f"parent_package['id'] : {parent_package['id']}")

if sample_id and 'id' in parent_package:
try:
Expand Down

0 comments on commit 18bfbb9

Please sign in to comment.