Skip to content
Browse files

Enforces limit 1 to ModelSet.first.

  • Loading branch information...
1 parent e69adfc commit 60bfedb1f2d0b8695b2db8c90709ae64d0e40424 @iamteem committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 redisco/models/modelset.py
View
2 redisco/models/modelset.py
@@ -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

0 comments on commit 60bfedb

Please sign in to comment.
Something went wrong with that request. Please try again.