mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Fix event names
This commit is contained in:
parent
4e5957eea2
commit
018f9e752c
@ -7,7 +7,7 @@ from flask_socketio import join_room, leave_room
|
|||||||
|
|
||||||
@socketio.on('GET /users/<user_id>')
|
@socketio.on('GET /users/<user_id>')
|
||||||
@socketio_login_required
|
@socketio_login_required
|
||||||
def subscribe_user(user_hashid):
|
def get_user(user_hashid):
|
||||||
user_id = hashids.decode(user_hashid)
|
user_id = hashids.decode(user_hashid)
|
||||||
user = User.query.get(user_id)
|
user = User.query.get(user_id)
|
||||||
if user is None:
|
if user is None:
|
||||||
@ -27,15 +27,13 @@ def subscribe_user(user_hashid):
|
|||||||
return {'code': 404, 'msg': 'Not found'}
|
return {'code': 404, 'msg': 'Not found'}
|
||||||
if not (user == current_user or current_user.is_administrator):
|
if not (user == current_user or current_user.is_administrator):
|
||||||
return {'code': 403, 'msg': 'Forbidden'}
|
return {'code': 403, 'msg': 'Forbidden'}
|
||||||
# dict_user = user.to_dict(backrefs=True, relationships=True)
|
|
||||||
join_room(f'/users/{user.hashid}')
|
join_room(f'/users/{user.hashid}')
|
||||||
# return {'code': 200, 'msg': 'OK', 'payload': dict_user}
|
|
||||||
return {'code': 200, 'msg': 'OK'}
|
return {'code': 200, 'msg': 'OK'}
|
||||||
|
|
||||||
|
|
||||||
@socketio.on('UNSUBSCRIBE /users/<user_id>')
|
@socketio.on('UNSUBSCRIBE /users/<user_id>')
|
||||||
@socketio_login_required
|
@socketio_login_required
|
||||||
def subscribe_user(user_hashid):
|
def unsubscribe_user(user_hashid):
|
||||||
user_id = hashids.decode(user_hashid)
|
user_id = hashids.decode(user_hashid)
|
||||||
user = User.query.get(user_id)
|
user = User.query.get(user_id)
|
||||||
if user is None:
|
if user is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user