Skip to content
This repository has been archived by the owner on Jul 20, 2018. It is now read-only.

Commit

Permalink
Enforces limit 1 to ModelSet.first.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamteem committed May 31, 2010
1 parent e69adfc commit 60bfedb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redisco/models/modelset.py
Expand Up @@ -64,7 +64,7 @@ def get_by_id(self, id):

def first(self):
try:
return self.__getitem__(0)
return self.limit(1).__getitem__(0)
except IndexError:
return None

Expand Down

0 comments on commit 60bfedb

Please sign in to comment.