Commit b8e79d8f authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

make sure that unreferenced compounds are not mistaken as validated

FIX #216
parent 9eccdf5f
Pipeline #29290 failed with stages
in 9 minutes and 41 seconds
......@@ -895,6 +895,11 @@ class Compound(AutoFillableModel):
return self.drugbankcompoundtanimoto_set.order_by("-tanimoto")
def is_validated(self):
# if compound is not linked to any CompoundAction this is
# because it was dereferenced because of duplication by
# `replace_compound_references`
if self.compoundaction_set.count()==0:
return False
for ca in self.compoundaction_set.all():
if ca.ppi.contribution_set.filter(validated=False).exists():
return False
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