From 9b3f63ab0defa4733164839090d8321c74570e52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20M=C3=A9nager?= <herve.menager@pasteur.fr>
Date: Tue, 15 Sep 2020 13:27:25 +0200
Subject: [PATCH] fix migration script

so that it uses the right verson of the model
---
 ippisite/ippidb/migrations/0063_fill_drugbank_links.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ippisite/ippidb/migrations/0063_fill_drugbank_links.py b/ippisite/ippidb/migrations/0063_fill_drugbank_links.py
index 061d1bf6..62ebadd5 100644
--- a/ippisite/ippidb/migrations/0063_fill_drugbank_links.py
+++ b/ippisite/ippidb/migrations/0063_fill_drugbank_links.py
@@ -3,13 +3,13 @@
 from django.db import migrations, models
 import django.db.models.deletion
 
-from ippidb.models import Compound, DrugBankCompound
-
 def run_generate_drugbank_inchikey(apps, schema_editor):
+    DrugBankCompound = apps.get_model("ippidb", "DrugBankCompound")
     for drugbank_compound in DrugBankCompound.objects.all():
         drugbank_compound.save(autofill=True)
 
 def set_compound_drugbank_links(apps, schema_editor):
+    Compound = apps.get_model("ippidb", "Compound")
     for compound in Compound.objects.all():
         compound.set_drugbank_link()
         compound.save()
-- 
GitLab