diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-04-16 16:57:26 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-04-16 16:57:26 +0200 |
commit | 07c2b124e4348b15f1e5ec18c6cdfd77248c6bc8 (patch) | |
tree | e4a29123d3ebedc1d25500390c904c66b3b02489 /api/social/request_list.py | |
parent | aa2c999702dadba2afbcf2be9f597f890aafcc87 (diff) |
spaces > tabs in python :(
Diffstat (limited to 'api/social/request_list.py')
-rw-r--r-- | api/social/request_list.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/api/social/request_list.py b/api/social/request_list.py index 9b79203..f991ce2 100644 --- a/api/social/request_list.py +++ b/api/social/request_list.py @@ -10,18 +10,18 @@ requests = Blueprint('requests', __name__) @requests.route("/requests") @auth_required("user") def route(user_2_id): - # get a list of friend requests - request_list = cursor.execute( - "select user_1_id from social where user_2_id = ? and type = \"outgoing\"", - [user_2_id] - ).fetchall() + # get a list of friend requests + request_list = cursor.execute( + "select user_1_id from social where user_2_id = ? and type = \"outgoing\"", + [user_2_id] + ).fetchall() - # get user_id for each result to prevent repeat user/info requests - formatted_request_list = [] - for user_1_id in [q[0] for q in request_list]: - formatted_request_list.append(format_user(user_1_id)) + # get user_id for each result to prevent repeat user/info requests + formatted_request_list = [] + for user_1_id in [q[0] for q in request_list]: + formatted_request_list.append(format_user(user_1_id)) - return {"requests": formatted_request_list}, 200 + return {"requests": formatted_request_list}, 200 dynamic_route = ["/social/list", requests] |