Merge pull request #668 from openreplay/api-v1.7.0_hotfix

Api v1.7.0 hotfix
This commit is contained in:
Kraiem Taha Yassine 2022-08-09 20:02:55 +02:00 committed by GitHub
commit b2faceba20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -138,7 +138,10 @@ def send_by_email(notification, destination):
def send_by_email_batch(notifications_list):
if not helper.has_smtp():
print("no SMTP configuration for email notifications")
if notifications_list is None or len(notifications_list) == 0:
print("no email notifications")
return
for n in notifications_list:
send_by_email(notification=n.get("notification"), destination=n.get("destination"))

View file

@ -560,6 +560,8 @@ class _SessionSearchEventRaw(__MixedSearchFilter):
assert len(values["source"]) > 0 and isinstance(values["source"][0], int), \
f"source of type int if required for {PerformanceEventType.time_between_events}"
else:
assert "source" in values, f"source is required for {values.get('type')}"
assert isinstance(values["source"], list), f"source of type list is required for {values.get('type')}"
for c in values["source"]:
assert isinstance(c, int), f"source value should be of type int for {values.get('type')}"
elif values.get("type") == EventType.error and values.get("source") is None:

View file

@ -174,6 +174,13 @@ const getValue = function (obj, key) {
return undefined;
}
const sortPaginate = function (list, filters) {
if (typeof (list) === "object" && !Array.isArray(list)) {
for (const [key, value] of Object.entries(list)) {
list[key] = sortPaginate(value, filters);
}
return list
}
const total = list.length;
list.sort((a, b) => {
const tA = getValue(a, "timestamp");