Skip to content

Commit

Permalink
fix: logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-chaturvedi committed Oct 8, 2023
1 parent 0988923 commit 41abd26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/backend/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ def resolve_logs(root, info, app_id, start=0, end=0):
f"phApp:v{app.app_version}:{app.identity_key}", start, end, 25)

else:
kms_logs = KMSDBLog.objects.filter(
app_id=f"phApp:v{app.app_version}:{app.identity_key}", timestamp__lte=end, timestamp__gte=start).order_by('-timestamp')[:25]
kms_logs = list(KMSDBLog.objects.filter(
app_id=f"phApp:v{app.app_version}:{app.identity_key}", timestamp__lte=end, timestamp__gte=start).order_by('-timestamp')[:25].values())

org_member = OrganisationMember.objects.get(
user=info.context.user, organisation=app.organisation, deleted_at=None)
Expand All @@ -261,7 +261,7 @@ def resolve_logs(root, info, app_id, start=0, end=0):
secret_events = SecretEvent.objects.filter(
environment__in=envs, timestamp__lte=end_dt, timestamp__gte=start_dt).order_by('-timestamp')[:25]

return LogsResponseType(kms=list(kms_logs.values()), secrets=secret_events)
return LogsResponseType(kms=kms_logs, secrets=secret_events)

def resolve_kms_logs_count(root, info, app_id):
if not user_can_access_app(info.context.user.userId, app_id):
Expand Down

0 comments on commit 41abd26

Please sign in to comment.