mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Let socketio decorators return instead of randomly emiting messages.
This commit is contained in:
parent
0d96a572e4
commit
371cd30893
@ -38,8 +38,7 @@ def socketio_admin_required(f):
|
||||
if current_user.is_administrator:
|
||||
return f(*args, **kwargs)
|
||||
else:
|
||||
response = {'code': 401, 'msg': 'Unauthorized'}
|
||||
socketio.emit(request.event['message'], response, room=request.sid)
|
||||
return {'code': 403, 'msg': 'Forbidden'}
|
||||
return wrapped
|
||||
|
||||
|
||||
@ -49,6 +48,5 @@ def socketio_login_required(f):
|
||||
if current_user.is_authenticated:
|
||||
return f(*args, **kwargs)
|
||||
else:
|
||||
response = {'code': 401, 'msg': 'Unauthorized'}
|
||||
socketio.emit(request.event['message'], response, room=request.sid)
|
||||
return {'code': 401, 'msg': 'Unauthorized'}
|
||||
return wrapped
|
||||
|
Loading…
Reference in New Issue
Block a user