Skip to content
Snippets Groups Projects

fixed errors in validate_extras

Merged Thorge Petersen requested to merge dev into master
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -64,13 +64,14 @@ def validate_extra_groups(data, requireAtLeastOne, errors):
@@ -64,13 +64,14 @@ def validate_extra_groups(data, requireAtLeastOne, errors):
def validate_extras(key, data, errors, context):
def validate_extras(key, data, errors, context):
extra_errors = {}
extra_errors = {}
 
isStaNord = ('id',) in data and data[('id',)][:7] == 'StaNord'
harvesting = ('ignore_auth' in context) and (context['ignore_auth'] == True)
harvesting = ('ignore_auth' in context) and (context['ignore_auth'] == True)
owner_org = data[('owner_org',)]
owner_org = data[('owner_org',)]
lenient_with = config.get('ckanext.odsh.lenient_with','')
lenient_with = config.get('ckanext.odsh.lenient_with','')
is_optional_temporal_start = toolkit.asbool(
is_optional_temporal_start = toolkit.asbool(
config.get('ckanext.odsh.is_optional_temporal_start', False)
config.get('ckanext.odsh.is_optional_temporal_start', False)
) ( harvesting and (owner_org in lenient_with) )
) or ( harvesting and (owner_org in lenient_with) )
require_at_least_one_category = toolkit.asbool(
require_at_least_one_category = toolkit.asbool(
config.get('ckanext.odsh.require_at_least_one_category', False)
config.get('ckanext.odsh.require_at_least_one_category', False)
Loading