Skip to content

Commit

Permalink
Merge branch 'develop' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaimran08 committed Feb 9, 2024
2 parents 26c0f8d + 3241585 commit b235000
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ def post(self, request, user, project):
}
res = requests.get(url, params=query)
res_json = res.json()["data"]["result"]

# TODO: change timestamp logic. Timestamps are different in prod and dev
for item in res_json:
for log_line in reversed(item["values"]):
# separate timestamp and log
separated_log = log_line[1].split(None, 1)
# improve timestamp formatting for table
formatted_time = datetime.strptime(separated_log[0][:-4], "%Y-%m-%dT%H:%M:%S.%f")
filtered_log = separated_log[0][:-4] if settings.DEBUG else separated_log[0][:-10]
formatted_time = datetime.strptime(filtered_log, "%Y-%m-%dT%H:%M:%S.%f")
separated_log[0] = datetime.strftime(formatted_time, "%Y-%m-%d, %H:%M:%S")
logs.append(separated_log)

Expand Down

0 comments on commit b235000

Please sign in to comment.