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
"""
del_hosts = []
for cred_id in creds_id:
self.conn.query(self.users_table).filter(
self.users_table.c.id == cred_id
).delete()
self.conn.commit()
self.conn.close()
q = delete(self.UsersTable).filter(
self.UsersTable.c.id == cred_id
)
del_hosts.append(q)
asyncio.run(self.conn.execute(q))
def add_admin_user(self, credtype, domain, username, password, host, user_id=None):
domain = domain.split('.')[0].upper()