def ask_update_contact():
    try:
        contacts.update_contact(e_name.get(), e_phone.get())
        clear_entries()
        tkMessageBox.showinfo("Success", "Contact updated")
    except ValueError as e:
        tkMessageBox.showerror("Error", e)
Esempio n. 2
0
def ask_update_contact():
    try:
        contacts.update_contact(e_name.get(), e_phone.get())
        clear_entries()
        tkMessageBox.showinfo("Success", "Contact updated")
    except ValueError as e:
        tkMessageBox.showerror("Error", e)
Esempio n. 3
0
def update():
    if request.method == 'POST':
        try:
            contacts.update_contact(request.form['name'],
                                    request.form['phone'])
            session['message'] = "Contact updated: {}".format(
                request.form['name'])
            return redirect('/')
        except ValueError as e:
            return render_template('update.html',
                                   message=e,
                                   name=request.form['name'],
                                   phone=request.form['phone'])
    return render_template('update.html')
Esempio n. 4
0
def update():
    if request.method == 'POST':
        try:
            contacts.update_contact(request.form['name'], request.form['phone'])
            session['message'] = "Contact updated: {}".format(request.form['name'])
            return redirect('/')
        except ValueError as e:
            return render_template(
                'update.html',
                message=e,
                name=request.form['name'],
                phone=request.form['phone']
            )
    return render_template('update.html')