def render_manual_detention_step_one(request): """Controller for rendering manual detention""" error = "" if request.method == 'POST': form = ManualDetentionTargetForm(request.POST) if form.is_valid(): try: check_target(form.cleaned_data['target'], trunk_ok=True) return redirect('arnold-manual-detention-step-two', form.cleaned_data['target']) except GeneralException as err: error = err else: form = ManualDetentionTargetForm() return render( request, 'arnold/manualdetain.html', create_context( 'Manual detention', { 'active': { 'manualdetention': True }, 'form': form, 'error': error }, ), )
def render_manual_detention_step_one(request): """Controller for rendering manual detention""" error = "" if request.method == 'POST': form = ManualDetentionTargetForm(request.POST) if form.is_valid(): try: check_target(form.cleaned_data['target'], trunk_ok=True) return redirect('arnold-manual-detention-step-two', form.cleaned_data['target']) except GeneralException, err: error = err
def render_manual_detention_step_one(request): """Controller for rendering manual detention""" error = "" if request.method == 'POST': form = ManualDetentionTargetForm(request.POST) if form.is_valid(): try: check_target(form.cleaned_data['target'], trunk_ok=True) return redirect('arnold-manual-detention-step-two', form.cleaned_data['target']) except GeneralException, err: error = err