Removed double function declaration (get_uid)
This commit is contained in:
parent
9fdd3ddc08
commit
11843fd9e1
@ -342,28 +342,13 @@ class DB_Mysql():
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
def get_uid(self, id_or_username):
|
|
||||||
log.debug("Finding user id of %s", id_or_username)
|
|
||||||
uname = id_or_username.split(".", 1)[0]
|
|
||||||
self.execute("SELECT `id` FROM `accounts` where username = %s", (uname))
|
|
||||||
row = self.dbc.fetchone()
|
|
||||||
|
|
||||||
|
|
||||||
if row is None:
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
uid = row[0]
|
|
||||||
return uid
|
|
||||||
|
|
||||||
|
|
||||||
def insert_worker(self, account_id, username, password):
|
def insert_worker(self, account_id, username, password):
|
||||||
log.debug("Adding new worker %s", username)
|
log.debug("Adding new worker %s", username)
|
||||||
query = "INSERT INTO pool_worker"
|
query = "INSERT INTO pool_worker"
|
||||||
self.execute(query + '(account_id, username, password) VALUES (%s, %s, %s);', (account_id, username, password))
|
self.execute(query + '(account_id, username, password) VALUES (%s, %s, %s);', (account_id, username, password))
|
||||||
self.dbh.commit()
|
self.dbh.commit()
|
||||||
return str(username)
|
return str(username)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.dbh.close()
|
self.dbh.close()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user