Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/api/endpoints/organization_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ def handle_delete(self, request: Request, organization):
transaction_id=schedule.guid,
)
organization.send_delete_confirmation(entry, ONE_DAY)
Organization.objects.uncache_object(organization.id)
context = serialize(
organization,
request.user,
Expand Down
4 changes: 4 additions & 0 deletions tests/sentry/api/endpoints/test_organization_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,10 @@ def test_can_remove_as_owner(self):
# No owners should be remaining
assert len(owner_emails) == 0

# Ensure cache was flushed
org = Organization.objects.get_from_cache(slug=org.slug)
assert org.status == OrganizationStatus.PENDING_DELETION

def test_cannot_remove_as_admin(self):
org = self.create_organization(owner=self.user)
user = self.create_user(email="[email protected]", is_superuser=False)
Expand Down