Commit 016f6566 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

make sure we do not crash on best activity during compound validation

fix #207
parent 271245df
Pipeline #28623 passed with stages
in 11 minutes and 8 seconds
......@@ -862,7 +862,11 @@ class Compound(AutoFillableModel):
best_pXC50_activity = self.best_activity
if best_pXC50_activity is None:
return None
return self.compoundactivityresult_set.filter(activity=best_pXC50_activity)[0]
best_cars = self.compoundactivityresult_set.filter(activity=best_pXC50_activity)
if len(best_cars) > 0:
return best_cars[0]
return None
def bioch_tests_count(self):
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