def logout(): # Clear out guests and checkins if demo account cur_user = current_user() if cur_user.is_demo: # Delete guest objects, checkin objects, and user object guests = Guest.query(Guest.restaurant_key==cur_user.key).fetch() for guest in guests: checkins = CheckIn.query(CheckIn.guest_key==guest.key).fetch() for checkin in checkins: checkin.key.delete() guest.key.delete() for msg in Message.query(Message.restaurant_key==cur_user.key).fetch(): msg.key.delete() for msgTemplate in MessageTemplate.query(MessageTemplate.restaurant_key==cur_user.key).fetch(): msgTemplate.key.delete() cur_user.key.delete() # Logs out User logout_account() return redirect(users.create_logout_url("/"))
def logout(): # Logs out User logout_account() return redirect(users.create_logout_url("/"))
def logout(): # Logs out Bookout user logout_account() #return redirect("/") # Logs out Google user return redirect(users.create_logout_url("/"))