From db8368e6fb62cc5cb7c4cfef60c74a8acc6387be Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Thu, 26 Oct 2023 21:22:50 +0200 Subject: [PATCH] Change back formating for readability --- nxc/protocols/winrm/database.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nxc/protocols/winrm/database.py b/nxc/protocols/winrm/database.py index e0cf477db..a0f06e22a 100644 --- a/nxc/protocols/winrm/database.py +++ b/nxc/protocols/winrm/database.py @@ -222,7 +222,15 @@ def add_admin_user(self, credtype, domain, username, password, host, user_id=Non add_links = [] creds_q = select(self.UsersTable) - creds_q = creds_q.filter(self.UsersTable.c.id == user_id) if user_id else creds_q.filter(func.lower(self.UsersTable.c.credtype) == func.lower(credtype), func.lower(self.UsersTable.c.domain) == func.lower(domain), func.lower(self.UsersTable.c.username) == func.lower(username), self.UsersTable.c.password == password) + if user_id: # noqa: SIM108 + creds_q = creds_q.filter(self.UsersTable.c.id == user_id) + else: + creds_q = creds_q.filter( + func.lower(self.UsersTable.c.credtype) == func.lower(credtype), + func.lower(self.UsersTable.c.domain) == func.lower(domain), + func.lower(self.UsersTable.c.username) == func.lower(username), + self.UsersTable.c.password == password, + ) users = self.conn.execute(creds_q) hosts = self.get_hosts(host)