Conversation
bjester
left a comment
There was a problem hiding this comment.
This is looking great! One comment about the UserHistory in combination with deleted_at, and see some tests are failing
contentcuration/contentcuration/migrations/0141_user_soft_delete.py
Outdated
Show resolved
Hide resolved
rtibbles
left a comment
There was a problem hiding this comment.
I think one more test would be good to give confidence here.
| files = File.objects.filter(contentnode__in=contentnode_ids) | ||
| files_on_storage = files.values_list("file_on_disk", flat=True) | ||
|
|
||
| for disk_file_path in files_on_storage: |
There was a problem hiding this comment.
Reinstating the file deletion behaviour here does make sense in the context of the PR - but would be good to have some tests on this function just to guarantee that we are definitely not deleting files that are being used in other channels - regardless of how simple the code may seem here.
There was a problem hiding this comment.
The reinstation of file deletion plays a critical role in garbage collection so I was determined to make sure it doesn't bring in bad things.
Thankfully, there were tests already written for the case when two contentnodes share the same file and there are more file deletion test cases under CleanUpContentNodesTestCase that cover other behaviours also:
studio/contentcuration/contentcuration/tests/utils/test_garbage_collect.py
Lines 237 to 241 in 172eb66
I have made sure that changing the file deletion behaviour fails the above tests. Since the current code passes the above tests, I am confident with my changes.
@rtibbles sir, if you think there's a case that's remaining to be tested...? then I'll definitely love to write test for that case.
|
Just a note that I've done some code review and testing of this, and so far everything is good. I still need to test the delayed portion |
|
Yes @bjester sir please take your time. |
|
I believe you mentioned this to me at one point, @vkWeb, but I don't think I understood-- seems that the copy in the user's account is a bit misleading:
If you've added an editor to the referenced channels, you still can't delete your account. It's wholly unrelated to your feature work here though |
bjester
left a comment
There was a problem hiding this comment.
We might want to remove the user from any channel's editors after the 90 day period, but I'm not sure if there are consequences to that. We could implement that another time.
Summary
Brings in user soft delete. User account data is kept intact. Recovery of user account is now possible. 🎉
Manual verification steps performed
user.recover()user can login after email verification.user.recover()user can register after email verification. (behaves same as invitation workflow)Reviewer guidance
Does manual verification mentioned above works on your end?
References
Closes #1990.
Contributor's Checklist
PR process:
CHANGELOGlabel been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocslabel has been added if this introduces a change that needs to be updated in the user docs?requirements.txtfiles also included in this PRStudio-specifc:
notranslateclass been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages,components, andlayoutsdirectories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarnandpip)