feat(mssqldb): update remove_credentials to be the same as smbdb

main
Marshall Hallenbeck 2023-03-08 13:06:55 -05:00
parent f9ff7cef7a
commit 38854a59e4
1 changed files with 6 additions and 5 deletions

View File

@ -217,12 +217,13 @@ class database:
""" """
Removes a credential ID from the database Removes a credential ID from the database
""" """
del_hosts = []
for cred_id in creds_id: for cred_id in creds_id:
self.conn.query(self.users_table).filter( q = delete(self.UsersTable).filter(
self.users_table.c.id == cred_id self.UsersTable.c.id == cred_id
).delete() )
self.conn.commit() del_hosts.append(q)
self.conn.close() asyncio.run(self.conn.execute(q))
def add_admin_user(self, credtype, domain, username, password, host, user_id=None): def add_admin_user(self, credtype, domain, username, password, host, user_id=None):
domain = domain.split('.')[0].upper() domain = domain.split('.')[0].upper()