-
Notifications
You must be signed in to change notification settings - Fork 308
add deactivate method to Participant #586
Comments
Hmmm ... this might not work, actually, because we need to keep the old participant_id around to display in other people's history pages. Let's leave this open pending discussion on #54. |
Okay, I think what we do is archive accounts like we do with the
Let's add a
The The niggle with history pages is iinm already present with absorbed accounts. The answer is to update the history page to use the |
Let's use this ticket for adding this functionality to the Participant object, and #664 for UI. |
Deletion is like absorption, and absorption is not ported to SQLAlchemy yet. I factored out the common part (archiving) and implemented deletion using the old wiring. This includes a few tests, but they're borked atm.
I needed an import to properly register the Deletion model with our SQLAlchemy wiring, so that the deletions table was emptied on teardown.
This adds more tests for the delete method. One of the areas I'm concerned about is the interaction between Participant.delete and the auth system. How does user.ANON behave with a deleted account? In exploring this I've uncovered a bug in User.from_session_token where the SQL "session_token = NULL" was translated into the SQLAlchemy expression "filter_by(session_token=None)", which generates the non-equivalent SQL expression "session_token is NULL". This is a potential security issue that needs to be addressed on master immediately. Therefore, I'm committing on this branch and switching over there.
When the user clicks the deactivate button, we want to convert them back to a stub participant, which is what gets created whenever we first hit
/on/twitter/fooname/
. We do keep anelsewhere
record in that case, and allelsewhere
records have a stubparticipant
. For example, we should reset statement and goal, claimed_time should be null, and id should be a random value.Look at how the merge flow works. We archive accounts as part of that.
I wish we didn't have to overwrite claimed_time. I don't like losing data. :-/
The text was updated successfully, but these errors were encountered: