Skip to content

Commit

Permalink
Make warning compatible with python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnland committed May 28, 2024
1 parent c869349 commit 3b012a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext/spatial/harvesters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,9 @@ def import_stage(self, harvest_object):
group_dict = logic.get_action('group_show')(context, {'id': group_id})
active_group = group_dict['state'] == 'active'
group_name = group_dict['display_name']
warn_message = ('WARNING: Created Empty Collection "{0}" after collection '.format(group_name) +
'reference was removed from child. Collection GUID: {0}'.format(group_id))
if active_group and group_dict['package_count'] == 1:
warn_message = (f'WARNING: Created Empty Collection "{group_name}" after collection ' +
f'reference was removed from child record. Collection GUID: {group_id}')
log.info(warn_message)
self._save_object_error(warn_message, harvest_object, 'Import')
except p.toolkit.ObjectNotFound:
Expand Down

0 comments on commit 3b012a8

Please sign in to comment.