handle ministry:college as a correct value for authors
This commit is contained in:
parent
a19e61c526
commit
377958e8b1
|
@ -284,16 +284,23 @@ class SyncFromThemis(UtilityView):
|
|||
continue
|
||||
related_docs.append(self.intids.getId(related_doc))
|
||||
object.related_docs = [RelationValue(x) for x in related_docs if x]
|
||||
|
||||
authors_v = None
|
||||
if data.get('auteur'):
|
||||
value = data.get('auteur')
|
||||
if type(value) is list:
|
||||
authors = [self.get_author_intid(x) for x in value]
|
||||
else:
|
||||
authors = [self.get_author_intid(value)]
|
||||
object.authors = [RelationValue(x) for x in authors if x]
|
||||
if data.get('auteurs'):
|
||||
authors = [self.get_author_intid(x) for x in data.get('auteurs')]
|
||||
object.authors = [RelationValue(x) for x in authors if x]
|
||||
authors_v = data.get('auteur')
|
||||
if type(authors_v) is not list:
|
||||
authors_v = [authors_v]
|
||||
elif data.get('auteurs'):
|
||||
authors_v = data.get('auteur')
|
||||
if authors_v == ['ministry:college']:
|
||||
object.author_is_government = True
|
||||
elif authors_v:
|
||||
authors_intids = [self.get_author_intid(x) for x in authors_v]
|
||||
object.authors = [RelationValue(x) for x in author_intids if x]
|
||||
object.author_is_government = False
|
||||
else:
|
||||
object.authors = None
|
||||
object.author_is_government = False
|
||||
|
||||
if data.get('etat_en_commission') and data.get('etat_en_commission') != u'Indéterminé':
|
||||
object.commission_status = data.get('etat_en_commission')
|
||||
|
|
Reference in New Issue