From 52293642b0158595db8d5b90feff914566858bf5 Mon Sep 17 00:00:00 2001 From: Ana Charpentier Date: Tue, 10 Feb 2015 17:26:41 +0100 Subject: Fix MAIN_AUTHOR on data_importer.py (create when not available) --- archaeological_operations/data_importer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archaeological_operations/data_importer.py b/archaeological_operations/data_importer.py index cec4e8104..94bbdff7c 100644 --- a/archaeological_operations/data_importer.py +++ b/archaeological_operations/data_importer.py @@ -218,12 +218,14 @@ class ParcelImporterBibracte(Importer): required=False,), ] +MAIN_AUTHOR, created = AuthorType.objects.get_or_create(txt_idx='main_author') + + class DocImporterBibracte(Importer): OBJECT_CLS = models.OperationSource DEFAULTS = { ('authors',):{ - 'author_type':AuthorType.objects.get( - txt_idx="main_author")}, + 'author_type':MAIN_AUTHOR}, } DESC = u"Exports Bibracte : importeur pour l'onglet documentation" LINE_FORMAT = [ -- cgit v1.2.3