From a176831df873705bd466e2973afc9da674e8f3c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr>
Date: Tue, 14 Mar 2017 21:36:49 +0100
Subject: [PATCH] handle patent data migration in import script

---
 ippisite/ippidb/management/commands/import_v1_data.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ippisite/ippidb/management/commands/import_v1_data.py b/ippisite/ippidb/management/commands/import_v1_data.py
index f6b60f8e..c49cf75e 100644
--- a/ippisite/ippidb/management/commands/import_v1_data.py
+++ b/ippisite/ippidb/management/commands/import_v1_data.py
@@ -15,7 +15,10 @@ class Command(BaseCommand):
         for row in rows:
             try:
                 b = Bibliography()
-                b.source = 'PM'
+                if row[1]=='article':
+                    b.source = 'PM'
+                else:
+                    b.source = 'PT'
                 b.id_source = row[2]
                 b.save()
             except Exception as e:
-- 
GitLab