Skip to content

Commit d38d318

Browse files
author
Joe Stubbs
committed
handle actors without webhook/link attributes defined
1 parent cc1d3ab commit d38d318

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

actors/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ def _get_events_attrs(self) -> str:
116116
except KeyError:
117117
logger.debug("did not find actor with id: {}".format(self.actor_id))
118118
raise errors.ResourceError("No actor found with identifier: {}.".format(self.actor_id), 404)
119+
# the link and webhook attributes were added in 1.2.0; actors registered before 1.2.0 will not have
120+
# have these attributed defined so we use the .get() method below --
119121
# if the webhook exists, we always try it.
120-
self.webhook = actor.webhook or ''
122+
self.webhook = actor.get('webhook') or ''
121123

122124
# the actor link might not exist
123-
link = actor.link or ''
125+
link = actor.get('link') or ''
124126
# if the actor link exists, it could be an actor id (not a dbid) or an alias.
125127
# the following code resolves the link data to an actor dbid
126128
if link:

0 commit comments

Comments
 (0)