def handle_add_user(json): print('add user using: ' + repr(json)) user = User(**json['data']) SS.add(user) SS.flush() print('user added') emit('user_added', { 'message': 'user {0} has been added, id: {1}'.format(user.emailAddress, user.userId), 'user': User.dump(user), }, broadcast=True)
def user(user): return jsonify(user=User.dump(user))