示例#1
0
def search_polis():
    form = HumanForm()
    if request.method == 'POST':
        if form.is_submitted():
            uncorrect_polis_list, polis = polis_helper.get_polises_by_fio(form.fam.data, form.im.data, form.datr.data.strftime('%d.%m.%Y'))
        return render_template('search_polis.html', form=form, polis=polis, uncorrect_polis_list=uncorrect_polis_list)
    else:
        return render_template('search_polis.html', form=form)
示例#2
0
def get_new_polis_by_old_polis():
    form = PolisForm()
    if request.method == 'POST':
        if form.is_submitted():
            human = polis_helper.get_fio_by_polis(form.serial.data, form.number.data)
            if human:
                uncorrect_polis_list, polis = polis_helper.get_polises_by_fio(human['fam'], human['im'], human['datr'])
                return render_template('search_new_polis.html', form=form, polis=polis, human=human)
            else:
                error = 'Извините, по вашему вопросу ничего не найдено'
                return render_template('search_new_polis.html', form=form, error=error)
    else:
        return render_template("search_new_polis.html", form=form)