From ab7031431f7c860bb0cebcabdfec54c3158179b3 Mon Sep 17 00:00:00 2001
From: anonymous <anonymous>
Date: Tue, 23 Apr 2019 15:11:43 +0200
Subject: [PATCH] fix validation

---
 ckanext/odsh/validation.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ckanext/odsh/validation.py b/ckanext/odsh/validation.py
index 1233070a..90efa8f2 100644
--- a/ckanext/odsh/validation.py
+++ b/ckanext/odsh/validation.py
@@ -52,8 +52,8 @@ 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.get(('groups', 0, 'id'), False) and not \
-            (data.get('groups', False) and len(data.get('groups'))>0):
+        if not data.get(('groups', 0, 'id'), False) and \
+           not data.get(('groups', 0, 'name'), False):
             errors['groups']= 'at least one group needed'
 
 def validate_extras(key, data, errors, context):
-- 
GitLab