diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-04-11 17:50:58 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-04-11 17:50:58 +0200 |
commit | 28f104de9ae9abe4b42abafbf3865ede5687996c (patch) | |
tree | 65e651f09d8fbf81380384692e45803cb4f9d61c /api/social/destroy_relation.py | |
parent | 7b4859059b3bbabf4139ccdf3270a82c094f5d8e (diff) |
dprint yapf python formatting
Diffstat (limited to 'api/social/destroy_relation.py')
-rw-r--r-- | api/social/destroy_relation.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/api/social/destroy_relation.py b/api/social/destroy_relation.py index 4b61ecd..ab72c48 100644 --- a/api/social/destroy_relation.py +++ b/api/social/destroy_relation.py @@ -7,32 +7,32 @@ import time remove = Blueprint('remove', __name__) -@remove.route('/remove', methods = ['POST']) + +@remove.route('/remove', methods=['POST']) @two_person_endpoint def index(user_1_id, user_2_id): - relation = get_relation_to(user_1_id, user_2_id) - if relation == "none": return "", 403 + relation = get_relation_to(user_1_id, user_2_id) + if relation == "none": return "", 403 + + remove_relation(user_1_id, user_2_id) + remove_relation(user_2_id, user_1_id) - remove_relation(user_1_id, user_2_id) - remove_relation(user_2_id, user_1_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) - 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 unblock = Blueprint('unblock', __name__) -@unblock.route('/unblock', methods = ['POST']) + +@unblock.route('/unblock', methods=['POST']) @two_person_endpoint def index(user_1_id, user_2_id): - if get_relation_to(user_1_id, user_2_id) != "blocked": return "", 403 + if get_relation_to(user_1_id, user_2_id) != "blocked": return "", 403 - remove_relation(user_1_id, user_2_id) - return "", 200 + remove_relation(user_1_id, user_2_id) + return "", 200 -dynamic_routes = [ - ["/social", remove], - ["/social", unblock] - ] +dynamic_routes = [["/social", remove], ["/social", unblock]] |