Commit 2b5942b1 authored by Birin Sanchez's avatar Birin Sanchez
Browse files

Remove consumed invitations when deleting an invitee account so the

Family pack owner can create a new invitation.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <>
parent 23b0bf18
Pipeline #36850 passed with stage
in 32 seconds
......@@ -8,6 +8,8 @@ from purist.limitmonitor import ServicesContainer
from limitmonitor.models import ExternalBundle, Limit
from limitmonitor.tunnel import TunnelManager
from limitmonitor.subscription import SubscriptionManager, SubscriptionStatus
from invitation.models import Invitation
logger = logging.getLogger(__name__)
......@@ -167,6 +169,14 @@ def delete_account(user, purge_n=0, purge=False):
# Remove WC PII
# If the account is of type invitee free up that invitation slot
if user.account_type == AccountType.INVITED:
inv = Invitation.objects.get(guest=user)
except Invitation.DoesNotExist as e:
if purge:
ldap_user = user.get_ldap()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment