Don't let the user specify mutually exclusive configuration options:

- organizations_filter_include
- organizations_filter_exclude
This commit is contained in:
Jardel Weyrich 2016-06-14 11:35:35 -03:00
parent f2d8a5f8cc
commit e8f539a45e
1 changed files with 5 additions and 0 deletions

View File

@ -147,6 +147,11 @@ class CKANHarvester(HarvesterBase):
if not isinstance(config_obj['default_extras'], dict): if not isinstance(config_obj['default_extras'], dict):
raise ValueError('default_extras must be a dictionary') raise ValueError('default_extras must be a dictionary')
if 'organizations_filter_include' in config_obj \
and 'organizations_filter_exclude' in config_obj:
raise ValueError('Harvest configuration cannot contain both '
'organizations_filter_include and organizations_filter_exclude')
if 'user' in config_obj: if 'user' in config_obj:
# Check if user exists # Check if user exists
context = {'model': model, 'user': toolkit.c.user} context = {'model': model, 'user': toolkit.c.user}