Skip to content

Commit

Permalink
Could not replicate intermittent occurrence of #34. Made a small chan…
Browse files Browse the repository at this point in the history
…ge, that should do the trick if the cursor behavior is changed by list()-ing it. Fixes #34.
  • Loading branch information
JasperVanDenBosch committed Sep 29, 2015
1 parent 214d237 commit b83ae1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions niprov/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ def statistics(self):
'count': { '$sum': 1 }
}
}])
if len(list(grps)) == 0:
groups = list(grps)
if len(list(groups)) == 0:
return {'count':0}
return list(grps)[0]
return list(groups)[0]

def byId(self, uid):
record = self.db.provenance.find_one({'id':uid})
Expand Down

0 comments on commit b83ae1b

Please sign in to comment.