Skip to content

Commit

Permalink
[model/count][xs]: deal with "edge" case where no results (nothing re…
Browse files Browse the repository at this point in the history
…turned by view function).
  • Loading branch information
rgrp committed Mar 19, 2011
1 parent 4e9927e commit 7f5de6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion annotator/model/couch.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ def count(self, **kwargs):
out = q[ vals ]
else:
out = q
return list(out)[0].value
out = list(out)
if out:
return out[0].value
else:
return 0


class Account(DomainObject):
Expand Down

0 comments on commit 7f5de6c

Please sign in to comment.