aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/users/views.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-07-17 10:09:11 -0500
committerFrederick Muriuki Muriithi2025-07-17 12:24:58 -0500
commit9517069a75e8212067a09f452a4de2e77ef55a70 (patch)
tree67ab94dd207a2c3bfa5ae1b342460b786fa8a3fe /gn_auth/auth/authorisation/users/views.py
parentecf1a9a1798db490ff49945eaa73c8e4c090d1a5 (diff)
downloadgn-auth-9517069a75e8212067a09f452a4de2e77ef55a70.tar.gz
Add note to self for possible "improvement" in user deletion
Add a note for considerations to make regarding recovery from error trying to delete users, so we can respond with more informative messages. Here, "improvement" is in quotes, because the priority leans more towards collecting more information for better feedback, which might be at the expense of speed of code.
Diffstat (limited to 'gn_auth/auth/authorisation/users/views.py')
-rw-r--r--gn_auth/auth/authorisation/users/views.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py
index 2ad672d..5843393 100644
--- a/gn_auth/auth/authorisation/users/views.py
+++ b/gn_auth/auth/authorisation/users/views.py
@@ -611,6 +611,13 @@ def delete_users():
("user_roles", "user_id"),
("user_verification_codes", "user_id"))
for _table, _col in _dependent_tables:
+ # TODO: Figure out which of these tables leads to an
+ # IntegrityError when attempting to do a delete.
+ # Might have to use code with really dismal performance
+ # here in order to get more information on what fails
+ # and for whom. Maybe a try-catch, with the catch
+ # calling a function that loops through each user and
+ # table, collecting failure stats.
cursor.execute(
f"DELETE FROM {_table} WHERE {_col} IN ({_paramstr})",
_delete)