forked from github/plane
chore: delete workspace invitation on user deactivation (#4514)
This commit is contained in:
parent
e951cc3cf4
commit
efe62bccf3
@ -25,6 +25,7 @@ from plane.db.models import (
|
|||||||
ProjectMember,
|
ProjectMember,
|
||||||
User,
|
User,
|
||||||
WorkspaceMember,
|
WorkspaceMember,
|
||||||
|
WorkspaceMemberInvite,
|
||||||
)
|
)
|
||||||
from plane.license.models import Instance, InstanceAdmin
|
from plane.license.models import Instance, InstanceAdmin
|
||||||
from plane.utils.cache import cache_response, invalidate_cache
|
from plane.utils.cache import cache_response, invalidate_cache
|
||||||
@ -154,6 +155,11 @@ class UserEndpoint(BaseViewSet):
|
|||||||
workspaces_to_deactivate, ["is_active"], batch_size=100
|
workspaces_to_deactivate, ["is_active"], batch_size=100
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Delete all workspace invites
|
||||||
|
WorkspaceMemberInvite.objects.filter(
|
||||||
|
email=user.email,
|
||||||
|
).delete()
|
||||||
|
|
||||||
# Deactivate the user
|
# Deactivate the user
|
||||||
user.is_active = False
|
user.is_active = False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user