Merge pull request #2788 from coreos-inc/fix-notifications

Fix notification system to use the new tuple correctly
This commit is contained in:
josephschorr 2017-07-14 00:26:16 +03:00 committed by GitHub
commit 2f750bfc87
5 changed files with 31 additions and 72 deletions

View file

@ -15,6 +15,8 @@ from endpoints.notificationmethod import (NotificationMethod,
CannotValidateNotificationMethodException)
from endpoints.notificationhelper import build_notification_data
from data import model
from workers.notificationworker.models_pre_oci import notification
logger = logging.getLogger(__name__)
def notification_view(note):
@ -191,7 +193,11 @@ class TestRepositoryNotification(RepositoryParamResource):
raise NotFound()
event_info = NotificationEvent.get_event(test_note.event.name)
sample_data = event_info.get_sample_data(test_note)
# TODO(jschorr): Stop depending on the worker module's data interface and instead only depend
# on the notification's data interface (to be added).
sample_data = event_info.get_sample_data(notification(test_note))
notification_data = build_notification_data(test_note, sample_data)
notification_queue.put([test_note.repository.namespace_user.username, repository,
test_note.event.name], json.dumps(notification_data))