def new_post(form): user = User(first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() return redirect(url_for('index'))
def new_post(self, display_name, club, email_address, password, **kw): if not club: club = None user = User(display_name=display_name, club_id=club, email_address=email_address, password=password) user.created_ip = request.remote_addr user.generate_tracking_key() DBSession.add(user) pilots = DBSession.query(Group).filter(Group.group_name == 'pilots').first() if pilots: pilots.users.append(user) redirect('/')
def new_post(form): user = User( first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data ) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() return redirect(url_for('index'))
def new_post(form): user = User( first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data ) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() flash(_('Welcome to SkyLines, %(user)s! You can now log in and share your flights with the world!', user=user)) return redirect(url_for('index'))
def new_post(form): user = User(first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() flash( _('Welcome to SkyLines, %(user)s! You can now log in and share your flights with the world!', user=user)) return redirect(url_for('index'))
def new_post(): json = request.get_json() if json is None: return jsonify(error='invalid-request'), 400 try: data = CurrentUserSchema(only=('email', 'firstName', 'lastName', 'password')).load(json).data except ValidationError as e: return jsonify(error='validation-failed', fields=e.messages), 422 user = User(**data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() return jsonify(user=UserSchema().dump(user).data)
def new_post(form): user = User(first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data) if form.club_id.data: user.club_id = form.club_id.data user.created_ip = request.remote_addr user.generate_tracking_key() db.session.add(user) create_new_user_event(user) if user.club_id: create_club_join_event(user.club_id, user) db.session.commit() return redirect(url_for('index'))
def new_post(): json = request.get_json() if json is None: return jsonify(error="invalid-request"), 400 try: data = (CurrentUserSchema(only=("email", "firstName", "lastName", "password")).load(json).data) except ValidationError as e: return jsonify(error="validation-failed", fields=e.messages), 422 user = User(**data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() return jsonify(user=UserSchema().dump(user).data)
def new_post(form): user = User( first_name=form.first_name.data, last_name=form.last_name.data, email_address=form.email_address.data, password=form.password.data ) if form.club_id.data: user.club_id = form.club_id.data user.created_ip = request.remote_addr user.generate_tracking_key() db.session.add(user) create_new_user_event(user) if user.club_id: create_club_join_event(user.club_id, user) db.session.commit() return redirect(url_for('index'))
@users_blueprint.route('/new', methods=['POST']) def new_post(): json = request.get_json() if json is None: return jsonify(error='invalid-request'), 400 try: data = CurrentUserSchema(only=('email', 'firstName', 'lastName', 'password')).load(json).data except ValidationError, e: return jsonify(error='validation-failed', fields=e.messages), 422 user = User(**data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() flash( _('Welcome to SkyLines, %(user)s! You can now log in and share your flights with the world!', user=user)) return jsonify(user=UserSchema().dump(user).data) @users_blueprint.route('/recover') def recover():
@users_blueprint.route('/users', methods=['POST'], strict_slashes=False) def new_post(): json = request.get_json() if json is None: return jsonify(error='invalid-request'), 400 try: data = CurrentUserSchema(only=('email', 'firstName', 'lastName', 'password')).load(json).data except ValidationError, e: return jsonify(error='validation-failed', fields=e.messages), 422 user = User(**data) user.created_ip = request.remote_addr db.session.add(user) create_new_user_event(user) db.session.commit() return jsonify(user=UserSchema().dump(user).data) @users_blueprint.route('/users/recover', methods=['POST']) def recover_post(): json = request.get_json() if json is None: return jsonify(error='invalid-request'), 400