fix username+auth combo check

This commit is contained in:
Andreas Köpf
2023-01-22 09:29:21 +01:00
parent 3b5b6669a5
commit 28089d9ecf
+1 -1
View File
@@ -693,7 +693,7 @@ class PromptRepository:
if user_id:
qry = qry.filter(Message.user_id == user_id)
if username or auth_method:
if not username and auth_method:
if not (username and auth_method):
raise OasstError("Auth method or username missing.", OasstErrorCode.AUTH_AND_USERNAME_REQUIRED)
qry = qry.join(User)
qry = qry.filter(User.username == username, User.auth_method == auth_method)