Skip to content

Commit

Permalink
Change back formating for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack committed Oct 26, 2023
1 parent afe4cd7 commit db8368e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nxc/protocols/winrm/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit db8368e

Please sign in to comment.