예제 #1
0
def ajax_go_off_duty(request):
    assert request.GET, "Error: no get data"
    duty = Duty.latest_open(user=request.display_user)
    assert duty, "No open Duty"
    ret = {}

    #---------

    duty.end = atd(request.GET['timestamp'])
    duty.save()

    ret['duty'] = duty.as_json_dict()

    return ret
예제 #2
0
def ajax_go_off_duty(request):
    assert request.GET, "Error: no get data"
    duty = Duty.latest_open(user=request.display_user)
    assert duty, "No open Duty"
    ret = {}
    
    #---------
      
    duty.end = atd(request.GET['timestamp'])
    duty.save()
    
    ret['duty'] = duty.as_json_dict()
    
    return ret
예제 #3
0
def ajax_go_on_duty(request):
    assert request.GET, "Error: no get data"
    ret = {}
    
    #---------

    duty = Duty.latest_open(user=request.display_user) or \
           Duty(user=request.display_user)
           
    duty.start = atd(request.GET['timestamp'])
    duty.save()
    
    #if not duty.latest_open_block():
    #    block = Block(duty=duty)
    #    block.save()
    #    ret['block_id'] = block.id
        
    ret['duty'] = duty.as_json_dict()
    
    return ret
예제 #4
0
def ajax_go_on_duty(request):
    assert request.GET, "Error: no get data"
    ret = {}

    #---------

    duty = Duty.latest_open(user=request.display_user) or \
           Duty(user=request.display_user)

    duty.start = atd(request.GET['timestamp'])
    duty.save()

    #if not duty.latest_open_block():
    #    block = Block(duty=duty)
    #    block.save()
    #    ret['block_id'] = block.id

    ret['duty'] = duty.as_json_dict()

    return ret