Compare commits
No commits in common. "d637f2a0eead835ff89dc60bd57c8b768bae22c7" and "8a64f84140e354e7b952d8cec8d322c3de9ed5de" have entirely different histories.
d637f2a0ee
...
8a64f84140
3 changed files with 1 additions and 21 deletions
|
@ -322,8 +322,6 @@ def get_progress():
|
||||||
completion_for_users = get_completion_for_users()
|
completion_for_users = get_completion_for_users()
|
||||||
progress = {}
|
progress = {}
|
||||||
for user_id in completion_for_users.keys():
|
for user_id in completion_for_users.keys():
|
||||||
if user_id not in db.USER_ID_TO_EMAIL_MAPPING:
|
|
||||||
continue
|
|
||||||
progress[user_id] = {
|
progress[user_id] = {
|
||||||
'email': db.USER_ID_TO_EMAIL_MAPPING[user_id],
|
'email': db.USER_ID_TO_EMAIL_MAPPING[user_id],
|
||||||
'exercises': {},
|
'exercises': {},
|
||||||
|
|
|
@ -197,21 +197,4 @@ def is_accepted_notification(notification) -> bool:
|
||||||
return True
|
return True
|
||||||
elif action in config.live_logs_accepted_scope[scope]:
|
elif action in config.live_logs_accepted_scope[scope]:
|
||||||
return True
|
return True
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def is_accepted_user_activity(notification) -> bool:
|
|
||||||
global VERBOSE_MODE
|
|
||||||
|
|
||||||
if notification['user_agent'] == 'misp-exercise-dashboard': # Ignore message generated from this app
|
|
||||||
return False
|
|
||||||
if '@' not in notification['user']: # Ignore message from system
|
|
||||||
return False
|
|
||||||
|
|
||||||
scope, action = get_scope_action_from_url(notification['url'])
|
|
||||||
if scope in config.uesr_activity_accepted_scope:
|
|
||||||
if config.uesr_activity_accepted_scope == '*':
|
|
||||||
return True
|
|
||||||
elif action in config.uesr_activity_accepted_scope[scope]:
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
|
@ -150,11 +150,10 @@ async def handleMessage(topic, s, message):
|
||||||
if notification_model.is_accepted_notification(notification):
|
if notification_model.is_accepted_notification(notification):
|
||||||
notification_model.record_notification(notification)
|
notification_model.record_notification(notification)
|
||||||
ZMQ_MESSAGE_COUNT_LAST_TIMESPAN += 1
|
ZMQ_MESSAGE_COUNT_LAST_TIMESPAN += 1
|
||||||
await sio.emit('notification', notification)
|
|
||||||
if notification_model.is_accepted_user_activity(notification):
|
|
||||||
user_id = notification_model.get_user_id(data)
|
user_id = notification_model.get_user_id(data)
|
||||||
if user_id is not None:
|
if user_id is not None:
|
||||||
USER_ACTIVITY[user_id] += 1
|
USER_ACTIVITY[user_id] += 1
|
||||||
|
await sio.emit('notification', notification)
|
||||||
|
|
||||||
user_id = notification_model.get_user_id(data)
|
user_id = notification_model.get_user_id(data)
|
||||||
if user_id is not None:
|
if user_id is not None:
|
||||||
|
|
Loading…
Reference in a new issue