Skip to content

Commit ea244c9

Browse files
committed
use the is_model_attr_cached method rather than just checking for the attribute
1 parent 541012c commit ea244c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sentry/workflow_engine/models/data_condition_group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from sentry.backup.scopes import RelocationScope
99
from sentry.db.models import DefaultFieldsModel, region_silo_model, sane_repr
1010
from sentry.db.models.manager.base import BaseManager
11+
from sentry.db.models.utils import is_model_attr_cached
1112
from sentry.workflow_engine.models.data_condition import DataConditionSnapshot
1213

1314

@@ -48,7 +49,7 @@ class Type(StrEnum):
4849

4950
def get_snapshot(self) -> DataConditionGroupSnapshot:
5051
conditions = []
51-
if hasattr(self, "conditions"):
52+
if is_model_attr_cached(self, "conditions"):
5253
conditions = [cond.get_snapshot() for cond in self.conditions.all()]
5354

5455
return {

0 commit comments

Comments
 (0)