Commit e11a0807 authored by Birin Sanchez's avatar Birin Sanchez

Do not delete users that have an ExternalCredit entry, which means

they completed the subscription billing process.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent ef4eaa92
Pipeline #10008 passed with stage
in 39 seconds
......@@ -231,8 +231,10 @@ def purge_users_pending_cart():
username = user.username
date_joined = user.date_joined
time_pending = now - date_joined
ec = ExternalCredit.objects.filter(account_name=user.get_identity())
paid = len(ec) > 0
if time_pending.total_seconds() > 60 * 60 * 24:
if time_pending.total_seconds() > 60 * 60 * 24 and not paid:
# Delete Ldap entry
ldap_user = LdapPerson.objects.filter(uid=username)
ldap_user.delete()
......
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