From 59e9113643bda1d25a96bb5875d303984725f6b5 Mon Sep 17 00:00:00 2001
From: anonymous <anonymous>
Date: Wed, 17 Apr 2019 09:38:18 +0200
Subject: [PATCH] fix validation bug

---
 ckanext/odsh/validation.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ckanext/odsh/validation.py b/ckanext/odsh/validation.py
index e90bd870..06de6824 100644
--- a/ckanext/odsh/validation.py
+++ b/ckanext/odsh/validation.py
@@ -52,7 +52,7 @@ def validate_extra_groups(data, requireAtLeastOne, errors):
             data[('groups', num, 'id')] = group
     else: # no extra-field 'groups'
         # dataset might come from a harvest process
-        if not data[('groups', 0, 'id')]:
+        if not data.get(('groups', 0, 'id'), False):
             errors['groups']= 'at least one group needed'
 
 def validate_extras(key, data, errors, context):
-- 
GitLab