Skip to content
Snippets Groups Projects
Commit fce96608 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

fix changing refs to compounds creating duplicates in other tables

such tables being CompoundTanimoto and DrugbankCompoundTanimoto
WIP on #212
parent 07afa195
No related branches found
No related tags found
1 merge request!13Master
Pipeline #29099 passed
......@@ -951,12 +951,10 @@ class Compound(AutoFillableModel):
for cpr in CompoundPKResult.objects.filter(compound=self):
cpr.compound = replacing_compound
cpr.save()
for ct in CompoundTanimoto.objects.filter(compound=self):
ct.compound = replacing_compound
ct.save()
for dct in DrugbankCompoundTanimoto.objects.filter(compound=self):
dct.compound = replacing_compound
dct.save()
# remove similarities with current component, in case any had been
# stored
CompoundTanimoto.objects.filter(compound=self).delete()
DrugbankCompoundTanimoto.objects.filter(compound=self).delete()
class CompoundTanimoto(models.Model):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment