Commit 76fde513 authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

bug fix: set_drugbank_link does not exist in old Compound model

parent 9566e42e
Pipeline #46783 failed with stages
in 18 minutes and 35 seconds
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
from django.db import migrations, models from django.db import migrations, models
from ippidb.models import DrugBankCompound as DrugBankCompound__latest from ippidb.models import DrugBankCompound as DrugBankCompound__latest
from ippidb.models import Compound as Compound__latest
import django.db.models.deletion import django.db.models.deletion
def run_generate_drugbank_inchikey(apps, schema_editor): def run_generate_drugbank_inchikey(apps, schema_editor):
...@@ -16,7 +17,8 @@ def run_generate_drugbank_inchikey(apps, schema_editor): ...@@ -16,7 +17,8 @@ def run_generate_drugbank_inchikey(apps, schema_editor):
def set_compound_drugbank_links(apps, schema_editor): def set_compound_drugbank_links(apps, schema_editor):
Compound = apps.get_model("ippidb", "Compound") Compound = apps.get_model("ippidb", "Compound")
for compound in Compound.objects.all(): for compound in Compound.objects.all():
compound.set_drugbank_link() # same bug than autofill commit '9566e42e'
((Compound__latest)(set_drugbank_link)).set_drugbank_link()
compound.save() compound.save()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment