def get(self): errors = self.session.get("errors", None) form_data = self.session.get("form_data", None) users = user_model.count_users() if users == 0: self.render("auth/create_user.html", errors=errors, form_data=form_data) else: self.redirect("/login")
def get(self): # Redirect if there are no users in the database users = user_model.count_users() if users == 0: self.redirect("/create_user") else: message = self.session.get("message",None) errors = self.session.get("errors",None) next = self.get_argument("next", None) self.delete_session_object("errors") self.delete_session_object("message") self.render("auth/login.html", message=message, errors=errors, next=next)
def get(self): # Redirect if there are no users in the database users = user_model.count_users() if users == 0: self.redirect("/create_user") else: message = self.session.get("message", None) errors = self.session.get("errors", None) next = self.get_argument("next", None) self.delete_session_object("errors") self.delete_session_object("message") self.render("auth/login.html", message=message, errors=errors, next=next)