From 41ceed411c2ffba60cc66876e2ffd9830a86b6a4 Mon Sep 17 00:00:00 2001
From: Alessandro Cerioni <acerioni@grandlyon.com>
Date: Tue, 9 Apr 2019 17:08:41 +0200
Subject: [PATCH] Fixing the handling of the isOpen editorial tag, which was
 broken after we introduced the licence attribute.

---
 7-doc-indexer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/7-doc-indexer.py b/7-doc-indexer.py
index b5cdbe1..853eb6f 100644
--- a/7-doc-indexer.py
+++ b/7-doc-indexer.py
@@ -20,7 +20,7 @@ def tag_doc( the_doc ):
     #   tag_dict[tag] = False
 
     # isOpen?
-    if not 'legalConstraints' in the_doc['metadata-fr'].keys() or not any( [x in the_doc['metadata-fr']['legalConstraints'] for x in ['Licence Associée', 'Licence Engagée'] ] ):
+    if 'license' in the_doc['metadata-fr'].keys() and not any( [x in the_doc['metadata-fr']['license'] for x in ['Licence Associée', 'Licence Engagée'] ] ):
         tag_dict['isOpenAccess'] = True
     else:
         tag_dict['isOpenAccess'] = False
-- 
GitLab