Skip to content

Commit

Permalink
fixed bug that if sample size was zero a type error would be thrown. …
Browse files Browse the repository at this point in the history
…In practice no datasets should ever be published and have no subjects but still a bad logic failure.
  • Loading branch information
rwblair committed Jan 12, 2016
1 parent 3e832f0 commit f323a44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion open_fmri/apps/dataset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def get_context_data(self, **kwargs):
context['num_datasets'] = len(Dataset.objects.filter(status='PUBLISHED'))
total = 0
for x in Dataset.objects.filter(status='PUBLISHED'):
total += x.sample_size
if x.sample_size is not None:
total += x.sample_size
context['num_subjects'] = total
return context

0 comments on commit f323a44

Please sign in to comment.