Offboard an AMC organization from edX - #423
Conversation
40ad031 to
319aafe
Compare
OmarIthawi
left a comment
There was a problem hiding this comment.
One big question: What happens to the courses and user entries? I think they will stay stray in the system.
Let's please check that first before merging this pull request. Having a test or two would be awesome!
There was a problem hiding this comment.
Is the domain unique at the database level?
There was a problem hiding this comment.
Yes. The primary key for Django's Site model is the domain.
|
@AhmedAljazzar Who would be performing the call? A customer or us? cc @OmarIthawi |
A Tahoe infrastructure admin like me or @AhmedAljazzar |
319aafe to
58d7b94
Compare
@johnbaldwin every one who have SSH access to our infrastructure. |
|
@OmarIthawi This is ready for another pass. |
|
@OmarIthawi This is also ready for another pass. |
|
Same here, thank you again! I'll review it soon. |
OmarIthawi
left a comment
There was a problem hiding this comment.
Thanks @AhmedAljazzar. Looks good to me!
There was a problem hiding this comment.
| organization = self._check_orrganization(organization_domain) | |
| delete_site(organization) | |
| self.stdout.write(self.style.SUCCESS('Successfully removed site "%s"' % organization_domain)) | |
| def _check_orrganization(self, domain): | |
| """ | |
| Locates the organization to be deleted and return its instance. | |
| organization = self.get_site(organization_domain) | |
| delete_site(organization) | |
| self.stdout.write(self.style.SUCCESS('Successfully removed site "%s"' % organization_domain)) | |
| def get_site(self, domain): | |
| """ | |
| Locates the site to be deleted and return its instance. |
Update docs Fix tests Updating tests Remove the white space Check for theme count Renaming
5cda9c1 to
68fb350
Compare
|
Applied the function renaming request, and squashed the commits. Waiting for tests to pass to merge. |
Background
We started this PR earlier in 2019 to help us remove a specific site from Tahoe. This step is necessary when we need to offboard a customer. However, we didn't have such a case until nw when one of our clients started working on their disaster and recovery plan.
What we are trying to achieve here, is building a tool that removes all high-level data of a specific organization. This data include high level hooks and relations (No courses, material, or logs):
This PR
Here we offboard an organization through a new API from edX platform by removing its data from the system. I also fixed the broken
delete_sitefunction that's now being used to offboard organizations.I was thinking of keeping all deleted organizations in the database, instead of removing them we can add a new field like
is_activeor similar, but that at the end of the day depends on the business logic, the customers we have, and how deep we are planning to go.Steps to Reproduce
To be able to use the API, you need to
make lms-shell.python manage.py lms <domain>. If you are running this on a local machine your domain should be.localhost:18000`Note: you can now create a website using
python manage.py lms create_devstack_site <slug>Related PRs