Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/sentry/api/endpoints/group_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

from rest_framework.response import Response

from sentry import eventstore
from sentry.api.base import DocSection
from sentry.api.bases import GroupEndpoint
from sentry.api.paginator import GenericOffsetPaginator
from sentry.api.serializers import EventSerializer, serialize
from sentry.models import Group, GroupHash, SnubaEvent
from sentry.models import Group, GroupHash
from sentry.tasks.unmerge import unmerge
from sentry.utils.apidocs import scenario, attach_scenarios
from sentry.utils.snuba import raw_query
Expand Down Expand Up @@ -79,14 +80,9 @@ def __handle_results(self, project_id, group_id, user, results):
return [self.__handle_result(user, project_id, group_id, result) for result in results]

def __handle_result(self, user, project_id, group_id, result):
event = {
"timestamp": result["latest_event_timestamp"],
"event_id": result["event_id"],
"group_id": group_id,
"project_id": project_id,
}
event = eventstore.get_event_by_id(project_id, result["event_id"])

return {
"id": result["primary_hash"],
"latestEvent": serialize(SnubaEvent(event), user, EventSerializer()),
"latestEvent": serialize(event, user, EventSerializer()),
}