Skip to content

Commit f4dfb0f

Browse files
committed
Fixed entity parsing to use properties attribute
1 parent 53b0d99 commit f4dfb0f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_notification_activity.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ def __init__(self, activity: Activity):
2121
entities = self.activity.entities or []
2222
for ent in entities:
2323
etype = ent.type.lower()
24-
payload = getattr(ent, "additional_properties", ent)
24+
25+
# Get the entity payload - check for properties attribute or convert to dict
26+
if hasattr(ent, "properties"):
27+
payload = ent.properties
28+
elif hasattr(ent, "__dict__"):
29+
payload = ent.__dict__
30+
else:
31+
payload = dict(ent) if hasattr(ent, "items") else {}
2532

2633
if etype == NotificationTypes.EMAIL_NOTIFICATION.lower() and self._email is None:
2734
try:

0 commit comments

Comments
 (0)