OpenDSA / OpenDSA-LTI

OpenDSA implementation using LTI communications
http://opendsa.org
Other
12 stars 38 forks source link

Delete on User fails #180

Open awhicks opened 1 month ago

awhicks commented 1 month ago

The admin view delete on a user fails if they have interacted with an OpenDSA course at all. There are four tables that have foreign key constraints that restrict a user from being deleted.

We need a custom delete action in the users admin page (https://github.com/OpenDSA/OpenDSA-LTI/blob/master/app/admin/users.rb) that either calls a cascading delete on the user or clears out the required tables by ID before deleting the user.

select * from users where email='email'; delete from odsa_book_progresses where user_id=num; delete from odsa_exercise_progresses where user_id=num; delete from odsa_module_progresses where user_id=num; delete from odsa_user_interactions where user_id=num; delete from users where id=num;