aboutsummaryrefslogtreecommitdiff
path: root/api/social/request_list.py
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-04-11 17:50:58 +0200
committerlonkaars <l.leblansch@gmail.com>2021-04-11 17:50:58 +0200
commit28f104de9ae9abe4b42abafbf3865ede5687996c (patch)
tree65e651f09d8fbf81380384692e45803cb4f9d61c /api/social/request_list.py
parent7b4859059b3bbabf4139ccdf3270a82c094f5d8e (diff)
dprint yapf python formatting
Diffstat (limited to 'api/social/request_list.py')
-rw-r--r--api/social/request_list.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/api/social/request_list.py b/api/social/request_list.py
index 624b3b4..8d1acd6 100644
--- a/api/social/request_list.py
+++ b/api/social/request_list.py
@@ -6,19 +6,22 @@ import time
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]
+dynamic_route = ["/social/list", requests]