Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 3
0
Arquivo: views.py Projeto: JPWKU/kaleo
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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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)
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 9
0
Arquivo: views.py Projeto: finid/kaleo
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")