예제 #1
0
def matchs_generate(request):
    if request.user.id!=None and request.user.is_authenticated and request.user.is_superuser:
        generate_events()
        generate_matchs()
        return HttpResponse('{"result": true, "message":"No problem"}', content_type="application/json");
    else:
        raise PermissionDenied()
예제 #2
0
def matchs_generate(request):
    if request.user.id != None and request.user.is_authenticated and request.user.is_superuser:
        generate_events()
        generate_matchs()
        return HttpResponse('{"result": true, "message":"No problem"}',
                            content_type="application/json")
    else:
        raise PermissionDenied()
예제 #3
0
def matchs_schedule_update(request):
    if request.user.id!=None and request.user.is_authenticated and request.user.is_superuser:
        match_id = request.POST['match_id']
        new_date = request.POST['new_date']
        new_time = request.POST['new_time']
        new_full_date = new_date + ' ' + new_time
        new_full_date = dt.strptime(new_full_date, '%Y-%m-%d %H:%M')
        match = Match.objects.get(id=match_id)
        match.when = new_full_date
        match.save()
        generate_events()
        generate_matchs()
        return HttpResponse('{"result": true, "message":"No problem"}', content_type="application/json");
    else:
        raise PermissionDenied()
예제 #4
0
def matchs_schedule_update(request):
    if request.user.id != None and request.user.is_authenticated and request.user.is_superuser:
        match_id = request.POST['match_id']
        new_date = request.POST['new_date']
        new_time = request.POST['new_time']
        new_full_date = new_date + ' ' + new_time
        new_full_date = dt.strptime(new_full_date, '%Y-%m-%d %H:%M')
        match = Match.objects.get(id=match_id)
        match.when = new_full_date
        match.save()
        generate_events()
        generate_matchs()
        return HttpResponse('{"result": true, "message":"No problem"}',
                            content_type="application/json")
    else:
        raise PermissionDenied()