From 3e7fea6c11e6afae2f8916c73b9aae9f411f0b3b Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 29 Nov 2024 23:45:34 -0500 Subject: [PATCH] Fix bugs in User.auth() --- lib/nntp/tiny/user.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/nntp/tiny/user.py b/lib/nntp/tiny/user.py index e626be2..e03f206 100644 --- a/lib/nntp/tiny/user.py +++ b/lib/nntp/tiny/user.py @@ -41,9 +41,14 @@ class User(DatabaseTable): and user_perm.user_id = ? """ - cr = db.execute(sql, self.id) + cr = db.execute(sql, (self.id,)) + + while True: + row = cr.fetchone() + + if row is None: + break - for row in cr.each(): perms |= UserPermission[row[0]] return perms