fix tests after rebase, use _get_namespace_name_from

This commit is contained in:
Evan Cordell 2017-07-18 11:07:55 -04:00
parent 57517adef3
commit 94c28b624e
2 changed files with 5 additions and 4 deletions

View file

@ -5,13 +5,14 @@ from contextlib import contextmanager
from app import app, notification_queue from app import app, notification_queue
from data import model from data import model
from auth.auth_context import get_authenticated_user, get_validated_oauth_token from auth.auth_context import get_authenticated_user, get_validated_oauth_token
from endpoints.notificationmethod import _get_namespace_name_from
DEFAULT_BATCH_SIZE = 1000 DEFAULT_BATCH_SIZE = 1000
def build_event_data(repo, extra_data=None, subpage=None): 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'], homepage = '%s://%s/repository/%s' % (app.config['PREFERRED_URL_SCHEME'],
app.config['SERVER_HOSTNAME'], app.config['SERVER_HOSTNAME'],
repo_string) repo_string)
@ -24,7 +25,7 @@ def build_event_data(repo, extra_data=None, subpage=None):
event_data = { event_data = {
'repository': repo_string, 'repository': repo_string,
'namespace': repo.namespace_name, 'namespace': _get_namespace_name_from(repo),
'name': repo.name, 'name': repo.name,
'docker_url': '%s/%s' % (app.config['SERVER_HOSTNAME'], repo_string), 'docker_url': '%s/%s' % (app.config['SERVER_HOSTNAME'], repo_string),
'homepage': homepage, 'homepage': homepage,

View file

@ -133,8 +133,8 @@ class QuayNotificationMethod(NotificationMethod):
return return
# Lookup the target user or team to which we'll send the notification. # Lookup the target user or team to which we'll send the notification.
config_data = json.loads(notification_obj.config_json) config_data = notification_obj.method_config_dict
status, err_message, target_users = self.find_targets(repository.namespace_user.username, repository.name, config_data) status, err_message, target_users = self.find_targets(_get_namespace_name_from(repository), repository.name, config_data)
if not status: if not status:
raise NotificationMethodPerformException(err_message) raise NotificationMethodPerformException(err_message)