Skip to content

Commit

Permalink
Logic if referrer is not using it.
Browse files Browse the repository at this point in the history
  • Loading branch information
asennoussi committed Aug 25, 2023
1 parent 332fa82 commit e5282d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ No matter what we write in our privacy policy or marketing copy, showing the act
After you grant access to your Contacts list and Gmail inbox, Emailgurus pull the list of contacts and irreversibly encrypts them: SHA256, so no one knows who is on your contact list. That's private, and only you own that data.
Then we create a label on your inbox called `EG:OUTSIDERS`, and its color is purple.

Then we kick off a listener on your inbox. The listener does only one thing: Listen to any changes happening to your inbox (excluding the SPAM box)
Then we kick off a listener on your inbox. The listener does only one thing: Listen to any changes happening to your inbox (excluding the SPAM box -- You have the option to include SPAM as well)

When there is an incoming email, we read the metadata: `FROM`, SHA256 it, and compare it against the saved records in the database.

Expand Down
8 changes: 8 additions & 0 deletions referral/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import timedelta
from accounts.models import CustomUser
from .models import Referral
from django.utils import timezone


@receiver(post_save, sender=CustomUser)
Expand All @@ -20,6 +21,13 @@ def process_referral(sender, instance, **kwargs):
if not referral.successful:
inviter = referral.inviter

if inviter.expires_at:
inviter.expires_at += timedelta(days=14)
else:
# Handle the case where expires_at is None
# You might want to set it to some default datetime value or log an error.
inviter.expires_at = timezone.now() + timedelta(days=14)

# Extend the inviter's payment due date by 14 days
inviter.expires_at += timedelta(days=14)
inviter.save()
Expand Down

0 comments on commit e5282d4

Please sign in to comment.