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

avoid crash when the compounds list resultset is empty

Former-commit-id: bc41c38f663e431a2bfb2b8bb7036b0ed249d410
parent e8419a04
No related branches found
No related tags found
No related merge requests found
...@@ -146,8 +146,8 @@ class IppiWizard(LoginRequiredMixin, NamedUrlSessionWizardView): ...@@ -146,8 +146,8 @@ class IppiWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
def process_cutoff_value(name, context, request, cutoff_dir='l'): def process_cutoff_value(name, context, request, cutoff_dir='l'):
c = context['compounds'] c = context['compounds']
context[name+'_max'] = str(int(math.ceil(float(c.aggregate(Max(name))[name + '__max'])))) context[name+'_max'] = str(int(math.ceil(float(c.aggregate(Max(name))[name + '__max'] or 0))))
context[name+'_min'] = str(int(math.floor(float(c.aggregate(Min(name))[name + '__min'])))) context[name+'_min'] = str(int(math.floor(float(c.aggregate(Min(name))[name + '__min'] or 0))))
if request.GET.get(name): if request.GET.get(name):
context[name] = request.GET.get(name) context[name] = request.GET.get(name)
filter_dict = {name + '__' + cutoff_dir + 'te': context[name]} filter_dict = {name + '__' + cutoff_dir + 'te': context[name]}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment