From: Rob van der Linde Date: Tue, 20 Feb 2024 02:37:21 +0000 (+1300) Subject: netcmd: models: Query.first and Query.last should use count from instance X-Git-Tag: tdb-1.4.11~1579 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3cc3ade434adcccedb0a45fb740a4f6ed5e0144;p=thirdparty%2Fsamba.git netcmd: models: Query.first and Query.last should use count from instance Signed-off-by: Rob van der Linde Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/netcmd/domain/models/query.py b/python/samba/netcmd/domain/models/query.py index 0b7fb2dd9a8..5c3a1527445 100644 --- a/python/samba/netcmd/domain/models/query.py +++ b/python/samba/netcmd/domain/models/query.py @@ -44,12 +44,12 @@ class Query: def first(self): """Returns the first item in the Query or None for no results.""" - if self.result.count: + if self.count: return self.model.from_message(self.ldb, self.result[0]) def last(self): """Returns the last item in the Query or None for no results.""" - if self.result.count: + if self.count: return self.model.from_message(self.ldb, self.result[-1]) def get(self):