def post(self): args = parser.parse_args() session = db_session.create_session() user = User( name=args["name"], about=args["about"], email=args["email"], created_date=args["created_date"], hashed_password=args["hashed_password"], ) session.add(user)
def post(self): try: args = parser.parse_args() session = db_session.create_session() user = User(name=args['name'], surname=args['surname'], age=args['age'], address=args['address'], email=args['email'], position=args['position'], speciality=args['speciality'], hashed_password=set_password(args['hashed_password'])) session.add(user) session.commit() except Exception as e: print(str(e)) return jsonify({'success': 'OK'})