def newguest(): form = NewGuestForm() if request.method == 'POST' and form.validate(): # the form has been filled out, import the data message = "Your guest account is created successfully. When you make a reservation, simply tell the customer service your name." if processCreateGuestForm(request.form): # print("Guest created successfully.") return render('success.html', message=message) else: # createGuest returned false, the guest could not be created. return render('basic.html', content="Could not create guest.") return render('newguest.html', form=form)
def page_reservation_wizard_3_new_guest_process(): # the form has been filled out, import the data formdata = request.form from RoomReserve.admin.guest import form_CreateGuest, processCreateGuestForm myGuest = processCreateGuestForm(formdata) if myGuest == False: # the guest could not be created. return render('basic.html', content="Could not create guest.") myGuestID = myGuest.get_id() myRes = getReservationByID(int(formdata['resID'])) myRes.setGuest(guestID=myGuestID) return render('reswizard/confirm.html', res=myRes)