Verified Commit 4144e165 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Fix message API.

parent 3145a308
Pipeline #30028 passed with stages
in 14 minutes and 44 seconds
......@@ -419,6 +419,7 @@ class AlarmApplication(ExtApplication):
"timestamp": self.to_json(ll.timestamp),
"from_status": ll.from_status,
"to_status": ll.to_status,
"source": getattr(ll, "source", ""),
"message": ll.message,
}
for ll in alarm.log
......@@ -523,7 +524,7 @@ class AlarmApplication(ExtApplication):
alarm = get_alarm(id)
if not alarm:
self.response_not_found()
alarm.log_message("%s: %s" % (request.user.username, msg))
alarm.log_message(msg, source=request.user.username)
return True
@view(
......@@ -537,7 +538,8 @@ class AlarmApplication(ExtApplication):
},
)
def api_comment_post(self, request, ids, msg):
alarms = ActiveAlarm.objects.filter(id__in=ids)
alarms = list(ActiveAlarm.objects.filter(id__in=ids))
alarms += list(ArchivedAlarm.objects.filter(id__in=ids))
if not alarms:
self.response_not_found()
for alarm in alarms:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment