04/17 Update: fixed email ingestion ticket error

This commit is contained in:
2026-04-17 14:52:38 -04:00
parent bcbb56cb7e
commit 3aff4cf895
+7 -4
View File
@@ -122,28 +122,31 @@ def ticket_stats():
@socketio.on('connect')
def on_connect():
if current_user.is_authenticated:
# current_user can be None when this handler is invoked without a session
# context (e.g. during a socketio.start_background_task emit from an
# APScheduler job). The None guard prevents AttributeError in that path.
if current_user and current_user.is_authenticated:
join_room(f'user_{current_user.id}')
logger.info(f'[SOCKET CONNECT] user_id={current_user.id}')
@socketio.on('disconnect')
def on_disconnect():
if current_user.is_authenticated:
if current_user and current_user.is_authenticated:
leave_room(f'user_{current_user.id}')
logger.info(f'[SOCKET DISCONNECT] user_id={current_user.id}')
@socketio.on('join_ticket')
def on_join_ticket(data):
if current_user.is_authenticated:
if current_user and current_user.is_authenticated:
ticket_id = data.get('ticket_id')
join_room(f'ticket_{ticket_id}')
@socketio.on('leave_ticket')
def on_leave_ticket(data):
if current_user.is_authenticated:
if current_user and current_user.is_authenticated:
ticket_id = data.get('ticket_id')
leave_room(f'ticket_{ticket_id}')