예제 #1
0
def schedule(request):
    # this is for each debugging only
    if not request.user.is_superuser:
        return HttpResponseForbidden()
    if request.REQUEST.get('update'):
        lunch = Lunch.get_latest(request.user)
        if not lunch:
            return HttpResponseNotFound()
        update_schedule(lunch, request.user)
        return HttpResponse('ran update_schedule')
    schedule_lunch(request.user)
    return HttpResponse('ran schedule_lunch')
예제 #2
0
def schedule_lunch_task(user_id):
    user = User.objects.get(id=user_id)
    logger.info("Scheduling lunches for user %s" % user)
    schedule_lunch(user)