From 94c28b624e43ffd145c54489b61f886ad3fbb369 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Tue, 18 Jul 2017 11:07:55 -0400 Subject: [PATCH] fix tests after rebase, use _get_namespace_name_from --- endpoints/notificationhelper.py | 5 +++-- endpoints/notificationmethod.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/endpoints/notificationhelper.py b/endpoints/notificationhelper.py index 37e5bc56b..18e313b8a 100644 --- a/endpoints/notificationhelper.py +++ b/endpoints/notificationhelper.py @@ -5,13 +5,14 @@ from contextlib import contextmanager from app import app, notification_queue from data import model from auth.auth_context import get_authenticated_user, get_validated_oauth_token +from endpoints.notificationmethod import _get_namespace_name_from DEFAULT_BATCH_SIZE = 1000 def build_event_data(repo, extra_data=None, subpage=None): - repo_string = '%s/%s' % (repo.namespace_name, repo.name) + repo_string = '%s/%s' % (_get_namespace_name_from(repo), repo.name) homepage = '%s://%s/repository/%s' % (app.config['PREFERRED_URL_SCHEME'], app.config['SERVER_HOSTNAME'], repo_string) @@ -24,7 +25,7 @@ def build_event_data(repo, extra_data=None, subpage=None): event_data = { 'repository': repo_string, - 'namespace': repo.namespace_name, + 'namespace': _get_namespace_name_from(repo), 'name': repo.name, 'docker_url': '%s/%s' % (app.config['SERVER_HOSTNAME'], repo_string), 'homepage': homepage, diff --git a/endpoints/notificationmethod.py b/endpoints/notificationmethod.py index 8725d9601..19c6ad9a5 100644 --- a/endpoints/notificationmethod.py +++ b/endpoints/notificationmethod.py @@ -133,8 +133,8 @@ class QuayNotificationMethod(NotificationMethod): return # Lookup the target user or team to which we'll send the notification. - config_data = json.loads(notification_obj.config_json) - status, err_message, target_users = self.find_targets(repository.namespace_user.username, repository.name, config_data) + config_data = notification_obj.method_config_dict + status, err_message, target_users = self.find_targets(_get_namespace_name_from(repository), repository.name, config_data) if not status: raise NotificationMethodPerformException(err_message)