예제 #1
0
def get_by_username(username):
    if User.get_user(username):
        return Response(str(User.get_user(username)),
                        200,
                        mimetype="application/json")
    else:
        return Response(error_message_helper("User not found"),
                        404,
                        mimetype="application/json")
예제 #2
0
def get_by_username(username):
    """Gets a user by username"""
    response = Response(str(User.get_user(username)),
                        200,
                        mimetype="application/json")
    return response