Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

harvest_responsible_organizations setting in harvester configuration crashes harvester if set as boolean value #18

Open
sjbruce opened this issue Jul 19, 2024 · 3 comments

Comments

@sjbruce
Copy link

sjbruce commented Jul 19, 2024

The harvester configuration is a JSON object, however, if harvest_responsible_organizations is set as a boolean value like the rest of the boolean options in the configuration the ckan_fetch_harvester container will crash because it is expecting a string value.

For consistency this should be updated to expect a boolean and either test for type or have a try/except block to catch the error and respond accordingly.

This snippet is from handle_groups() function in plugin.py, the line in question is 125

        harvest_responsible_organizations = (source_config.get('harvest_responsible_organizations') or toolkit.config.get('ckan.harvest_responsible_organizations') or 'true').lower()
        if harvest_responsible_organizations == "true":
            # Handle org mapping using metadata cited-responsible-party
            log.info(':::::::::::::-Handle Groups-::::::::::::: %r ', cats)
        else:
            log.debug(':::::::::::::-Skipping Handle Groups-::::::::::::: %r ', cats)
            return validated_groups
@fostermh
Copy link
Member

fostermh commented Jul 19, 2024 via email

@sjbruce
Copy link
Author

sjbruce commented Jul 20, 2024 via email

@fostermh
Copy link
Member

they are funnelled into the config object yes. they are treated as strings. For example, a value of "true" in the config is the string "true" not a boolean value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants