Beispiel #1
0
def addto_user(request, pk):
    user = get_object_or_404(get_user_model(), pk=pk)
    amount = int(request.POST.get("amount"))
    InvitationStat.add_invites_to_user(user=user, amount=amount)
    return HttpResponse(json.dumps({
        "html": amount
    }), content_type="application/json")
Beispiel #2
0
def addto_user(request, pk):
    user = get_object_or_404(User, pk=pk)
    amount = int(request.POST.get("amount"))
    InvitationStat.add_invites_to_user(user=user, amount=amount)
    return HttpResponse(json.dumps({
        "html": amount
    }), content_type="application/json")
Beispiel #3
0
def topoff_user(request, pk):
    user = get_object_or_404(get_user_model(), pk=pk)
    amount = int(request.POST.get("amount"))
    InvitationStat.topoff_user(user=user, amount=amount)
    return HttpResponse(json.dumps({
        "html": amount
    }), content_type="application/json")
Beispiel #4
0
def addto_all(request):
    amount = int(request.POST.get("amount"))
    InvitationStat.add_invites(amount)
    return HttpResponse(json.dumps(
        {"inner-fragments": {
            ".amount-added": amount
        }}),
                        content_type="application/json")
Beispiel #5
0
def topoff_all(request):
    amount = int(request.POST.get("amount"))
    InvitationStat.topoff(amount)
    return HttpResponse(json.dumps(
        {"inner-fragments": {
            ".invite-total": amount
        }}),
                        content_type="application/json")
Beispiel #6
0
 def handle(self, *args, **kwargs):
     if len(args) == 0:
         sys.exit("You must supply the number of invites as an argument.")
     
     try:
         num_of_invites = int(args[0])
     except ValueError:
         sys.exit("The argument for number of invites must be an integer.")
     
     InvitationStat.topoff(num_of_invites)
Beispiel #7
0
def addto_all(request):
    amount = int(request.POST.get("amount"))
    InvitationStat.add_invites(amount)
    return HttpResponse(json.dumps({
        "inner-fragments": {".amount-added": amount}
    }), content_type="application/json")
Beispiel #8
0
def topoff_all(request):
    amount = int(request.POST.get("amount"))
    InvitationStat.topoff(amount)
    return HttpResponse(json.dumps({
        "inner-fragments": {".invite-total": amount}
    }), content_type="application/json")
Beispiel #9
0
def topoff_user(request, pk):
    user = get_object_or_404(User, pk=pk)
    amount = int(request.POST.get("amount"))
    InvitationStat.topoff_user(user=user, amount=amount)
    return HttpResponse(json.dumps({"html": amount}),
                        content_type="application/json")