Skip to content

Commit

Permalink
chore: Fix bug referrals
Browse files Browse the repository at this point in the history
  • Loading branch information
phuongntt-cystack committed Feb 13, 2024
1 parent 96aa6bb commit fb65d09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions locker_server/api/v1_0/referrals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ def claim(self, request, *args, **kwargs):

# Upgrade current user to Premium
current_time = now()
self.user_service.update_plan(user=user, plan_type_alias=PLAN_TYPE_PM_PREMIUM, **{
"start_period": current_time,
"end_period": current_time + 30 * 86400,
"cancel_at_period_end": True
})
self.user_service.update_plan(
user_id=user.user_id, plan_type_alias=PLAN_TYPE_PM_PREMIUM,
**{
"start_period": current_time,
"end_period": current_time + 30 * 86400,
"cancel_at_period_end": True
}
)
# Get current plan of the referred user
if count < REFERRAL_LIMIT:
referred_user_plan = self.user_service.get_current_plan(
Expand Down

0 comments on commit fb65d09

Please sign in to comment.