Exemple #1
0
def upgrade_premium(request):
    user_id = request.REQUEST.get('user_id')
    user = User.objects.get(pk=user_id)
    
    gift = MGiftCode.add(gifting_user_id=User.objects.get(username='******').pk, 
                         receiving_user_id=user.pk)
    MRedeemedCode.redeem(user, gift.gift_code)
    
    return {'code': user.profile.is_premium}
Exemple #2
0
def upgrade_premium(request):
    user_id = request.POST.get('user_id')
    user = User.objects.get(pk=user_id)

    gift = MGiftCode.add(
        gifting_user_id=User.objects.get(username='******').pk,
        receiving_user_id=user.pk)
    MRedeemedCode.redeem(user, gift.gift_code)

    return {'code': user.profile.is_premium}