fixed user removal
This commit is contained in:
parent
44dde0cf6d
commit
80e42ff1e3
@ -15,8 +15,6 @@ class UserManager(object):
|
|||||||
return DatabaseConnection.global_single_query(query, (user_name))
|
return DatabaseConnection.global_single_query(query, (user_name))
|
||||||
|
|
||||||
def delete_user(self, user_name):
|
def delete_user(self, user_name):
|
||||||
query = "DELETE FROM users where name=%s"
|
|
||||||
DatabaseConnection.global_single_execution(query, (user_name))
|
|
||||||
|
|
||||||
# remove from friends:
|
# remove from friends:
|
||||||
query = "DELETE FROM friends WHERE user=%s"
|
query = "DELETE FROM friends WHERE user=%s"
|
||||||
@ -25,6 +23,19 @@ class UserManager(object):
|
|||||||
query = "DELETE FROM friends WHERE friend=%s"
|
query = "DELETE FROM friends WHERE friend=%s"
|
||||||
DatabaseConnection.global_single_execution(query, (user_name))
|
DatabaseConnection.global_single_execution(query, (user_name))
|
||||||
|
|
||||||
|
# remove from sessions:
|
||||||
|
query = "DELETE FROM sessions WHERE registered_user=%s"
|
||||||
|
DatabaseConnection.global_single_execution(query, (user_name))
|
||||||
|
|
||||||
|
# remove from matches:
|
||||||
|
query = "DELETE FROM matches WHERE user_a=%s OR user_b=%s"
|
||||||
|
DatabaseConnection.global_single_execution(query, (user_name, user_name))
|
||||||
|
|
||||||
|
# finally remove user
|
||||||
|
|
||||||
|
query = "DELETE FROM users where name=%s"
|
||||||
|
DatabaseConnection.global_single_execution(query, (user_name))
|
||||||
|
|
||||||
def verify_user(self, user_name, pw):
|
def verify_user(self, user_name, pw):
|
||||||
query = "SELECT * FROM users where name=%s"
|
query = "SELECT * FROM users where name=%s"
|
||||||
users = DatabaseConnection.global_single_query(query, (user_name))
|
users = DatabaseConnection.global_single_query(query, (user_name))
|
||||||
|
Loading…
Reference in New Issue
Block a user