Exemplo n.º 1
0
def reject_transfer_request(request):
    applicant = request.GET['student_username']
    status = ApplicationsStatus.REJECTED.value
    rejected_by = request.user.userprofile.user_type
    saved = update_application(applicant, rejected_by, status)
    response = {}
    if saved:
        response['error'] = False
        response['message'] = 'Application rejected.'
    else:
        response['error'] = True
        response['message'] = 'Failed to reject application!'
    return JsonResponse(response, safe=False)
Exemplo n.º 2
0
def approve_transfer_request(request):
    applicant = request.GET['student_username']
    status = request.GET['status']
    approved_by = request.user.userprofile.user_type
    application_type = int(request.GET.get('application_type'))
    comments = request.GET.get('comments')
    saved = update_application(applicant, application_type, approved_by, status, comments)
    response = {}
    if saved:
        response['error'] = False
        response['message'] = 'Application approved.'
    else:
        response['error'] = True
        response['message'] = 'Failed to approve application!'
    return JsonResponse(response, safe=False)
Exemplo n.º 3
0
def reject_transfer_request(request):
    applicant = request.GET['student_username']
    application_type = request.GET.get('application_type')
    # Assoc Dean can only reject the form
    status = ApplicationsStatus.REJECTED.value
    rejected_by = request.user.userprofile.user_type
    # Client should send the comments too.
    comments = request.GET.get('comments')
    saved = update_application(applicant, application_type, rejected_by,
                               status, comments)
    response = {}
    if saved:
        response['error'] = False
        response['message'] = 'Application rejected.'
    else:
        response['error'] = True
        response['message'] = 'Failed to reject application!'
    return JsonResponse(response, safe=False)