def proofing_requests(request, proofing_task_id=None, decision=None): """ Displays proofing request to proofreaders :param request: HttpRequest object :param proofing_task_id: ProofingTask PK :param decision: string, :return: HttpResponse or HttpRedirect """ if proofing_task_id: if proofing_task_id: logic.handle_proof_decision(request, proofing_task_id, decision) return redirect(reverse('proofing_requests')) new, active, completed = logic.get_tasks(request) template = 'proofing/proofing_requests.html' context = { 'new_requests': new, 'active_requests': active, 'completed_requests': completed, } return render(request, template, context)
def proofing_requests(request, proofing_task_id=None, typeset_task_id=None, decision=None): if proofing_task_id or typeset_task_id: if proofing_task_id: logic.handle_proof_decision(request, proofing_task_id, decision) if typeset_task_id: logic.handle_typeset_decision(request, typeset_task_id, decision) return redirect(reverse('proofing_requests')) new, active, completed, new_typesetting, active_typesetting, completed_typesetting = logic.get_tasks(request) template = 'proofing/proofing_requests.html' context = { 'new_requests': new, 'active_requests': active, 'completed_requests': completed, 'new_typesetting_requests': new_typesetting, 'active_typesetting_requests': active_typesetting, 'completed_typesetting_requests': completed_typesetting, } return render(request, template, context)