Skip to content

Commit

Permalink
fix: query.first()
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Feb 9, 2023
1 parent 58b4f9b commit e78ec33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions peewee.py
Original file line number Diff line number Diff line change
@@ -2215,10 +2215,10 @@ def peek(self, database, n=1):

@database_required
def first(self, database, n=1):
query = self
if self._limit != n:
self._limit = n
self._cursor_wrapper = None
return self.peek(database, n=n)
query = self.limit(n)
return query.peek(database, n=n)

@database_required
def scalar(self, database, as_tuple=False, as_dict=False):

0 comments on commit e78ec33

Please sign in to comment.