- Change updated_tags into the expected dict, not a list

- Update the event code on both sides to expect the dict
- Add filter support to the string builder
This commit is contained in:
Joseph Schorr 2014-08-05 17:45:40 -04:00
parent 420d02cd71
commit 7e8713171e
3 changed files with 35 additions and 7 deletions

View file

@ -59,7 +59,7 @@ class RepoPushEvent(NotificationEvent):
return 'Repository %s updated' % (event_data['repository'])
def get_message(self, event_data, notification_data):
if not event_data.get('updated_tags', []):
if not event_data.get('updated_tags', {}).keys():
html = """
Repository <a href="%s">%s</a> has been updated via a push.
""" % (event_data['homepage'],
@ -71,13 +71,13 @@ class RepoPushEvent(NotificationEvent):
Tags Updated: %s
""" % (event_data['homepage'],
event_data['repository'],
', '.join(event_data['updated_tags']))
', '.join(event_data['updated_tags'].keys()))
return html
def get_sample_data(self, repository):
return build_event_data(repository, {
'updated_tags': ['latest', 'foo', 'bar'],
'updated_tags': {'latest': 'someimageid', 'foo': 'anotherimage'},
'pushed_image_count': 10,
'pruned_image_count': 3
})