Repository navigation
Hand an erased teacher's classes to a co-teacher, or delete them - #64
Merged
Merged
Conversation
When a teacher's account is erased (by Rotur's webhook or by deleting their own account), each class they owned passes to its first co-teacher. A class with no co-teacher is deleted with its students, as admin purge does. They also leave every class they co-taught and their school, and a school losing its last admin promotes its first remaining teacher.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a teacher's account was erased, by Rotur's webhook or by them deleting their MistWarp account,
eraseUserleft their classes and students behind. Only admin purge cleaned them up.Now
eraseUserstarts by handing over the teacher's Classroom data:This runs whether or not
CLASSROOM_ENABLEDis on, since it's cleanup. A Stripe subscription the teacher had isn't touched; it stays with Stripe until cancelled there.The decisions live in two pure functions in
classroom-policy.osl,classAfterTeacherErasedandschoolAfterTeacherErased, with tests inclassroom-policy.test.osl.osl testpasses (44/44), the touched files have no warnings, and the API compiles.No visible change.