aboutsummaryrefslogtreecommitdiff
path: root/api/social/friend_accept.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/social/friend_accept.py')
-rw-r--r--api/social/friend_accept.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/api/social/friend_accept.py b/api/social/friend_accept.py
index 4f1f847..75dd3b9 100644
--- a/api/social/friend_accept.py
+++ b/api/social/friend_accept.py
@@ -6,17 +6,20 @@ import time
accept = Blueprint('accept', __name__)
-@accept.route("/accept", methods = ['POST'])
+
+@accept.route("/accept", methods=['POST'])
@two_person_endpoint
def route(user_1_id, user_2_id):
- cursor.execute("update social set type = \"friendship\" where user_1_id = ? and user_2_id = ?",
- [user_2_id, user_1_id])
- connection.commit()
+ cursor.execute(
+ "update social set type = \"friendship\" where user_1_id = ? and user_2_id = ?",
+ [user_2_id, user_1_id]
+ )
+ connection.commit()
- io.emit("changedRelation", { "id": user_2_id }, room="user-"+user_1_id)
- io.emit("changedRelation", { "id": user_1_id }, room="user-"+user_2_id)
+ io.emit("changedRelation", {"id": user_2_id}, room="user-" + user_1_id)
+ io.emit("changedRelation", {"id": user_1_id}, room="user-" + user_2_id)
- return "", 200
+ return "", 200
-dynamic_route = ["/social", accept]
+dynamic_route = ["/social", accept]