From 2f4536d6b08b69168ebf3e718cbd8e3002b9af5a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 28 Mar 2021 12:19:28 +0200 Subject: added comments --- api/social/create_relation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api/social/create_relation.py') diff --git a/api/social/create_relation.py b/api/social/create_relation.py index eb38978..7e7c466 100644 --- a/api/social/create_relation.py +++ b/api/social/create_relation.py @@ -4,6 +4,8 @@ from hierarchy import auth_required from socket_io import io import time +# @two_person_endpoint decorator +# defines (user_1_id, user_2_id) in endpoint handler function arguments def two_person_endpoint(func): @auth_required("user") def wrapper(user_1_id): @@ -26,6 +28,7 @@ def create_relation(user_1_id, user_2_id, relation_type): [user_1_id, user_2_id, relation_type, timestamp]) connection.commit() +# remove relation between user_1_id and user_2_id (one-way) def remove_relation(user_1_id, user_2_id): cursor.execute("delete from social where user_1_id = ? and user_2_id = ?", [user_1_id, user_2_id]) @@ -42,7 +45,6 @@ def create_relation_route(relation_type): return "", 200 return route - friend_request = Blueprint('friend_request', __name__) friend_request.add_url_rule('/request', 'route', create_relation_route("outgoing"), methods = ["POST"]) -- cgit v1.2.3