Skip to content

Commit

Permalink
add metadata property to GroupHash
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Aug 15, 2024
1 parent f36ad18 commit 6ac78b1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/sentry/models/grouphash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from django.db import models
from django.utils.translation import gettext_lazy as _

Expand All @@ -9,6 +13,9 @@
region_silo_model,
)

if TYPE_CHECKING:
from sentry.models.grouphashmetadata import GroupHashMetadata


@region_silo_model
class GroupHash(Model):
Expand All @@ -35,3 +42,10 @@ class Meta:
app_label = "sentry"
db_table = "sentry_grouphash"
unique_together = (("project", "hash"),)

@property
def metadata(self) -> GroupHashMetadata | None:
try:
return self._metadata
except AttributeError:
return None

0 comments on commit 6ac78b1

Please sign in to comment.