From 33039e9bc421eed17ef9dba57310c96f7f0e431a Mon Sep 17 00:00:00 2001
From: Joseph Schorr <joseph.schorr@coreos.com>
Date: Mon, 29 Jun 2015 12:18:21 +0300
Subject: [PATCH] New layout cleanup: Remove second GH trigger path

---
 endpoints/githubtrigger.py            | 13 ++-----------
 static/js/services/trigger-service.js |  4 ----
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/endpoints/githubtrigger.py b/endpoints/githubtrigger.py
index 8954e9119..cd14cd310 100644
--- a/endpoints/githubtrigger.py
+++ b/endpoints/githubtrigger.py
@@ -18,7 +18,6 @@ client = app.config['HTTPCLIENT']
 githubtrigger = Blueprint('callback', __name__)
 
 @githubtrigger.route('/github/callback/trigger/<path:repository>', methods=['GET'])
-@githubtrigger.route('/github/callback/trigger/<path:repository>/__new', methods=['GET'])
 @route_show_if(features.GITHUB_BUILD)
 @require_session_login
 @parse_repository_name
@@ -33,18 +32,10 @@ def attach_github_build_trigger(namespace, repository):
       abort(404, message=msg)
 
     trigger = model.create_build_trigger(repo, 'github', token, current_user.db_user())
-
-    # TODO(jschorr): Remove once the new layout is in place.
-    admin_path = '%s/%s/%s' % (namespace, repository, 'admin')
-    full_url = '%s%s%s' % (url_for('web.repository', path=admin_path), '?tab=trigger&new_trigger=',
+    repo_path = '%s/%s' % (namespace, repository)
+    full_url = '%s%s%s' % (url_for('web.repository', path=repo_path), '?tab=builds&newtrigger=',
                            trigger.uuid)
 
-    if '__new' in request.url:
-      repo_path = '%s/%s' % (namespace, repository)
-      full_url = '%s%s%s' % (url_for('web.repository', path=repo_path), '?tab=builds&newtrigger=',
-                             trigger.uuid)
-
-
     logger.debug('Redirecting to full url: %s', full_url)
     return redirect(full_url)
 
diff --git a/static/js/services/trigger-service.js b/static/js/services/trigger-service.js
index e597e5628..5826804bc 100644
--- a/static/js/services/trigger-service.js
+++ b/static/js/services/trigger-service.js
@@ -23,10 +23,6 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
         var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' +
           namespace + '/' + repository;
 
-        if (Config.isNewLayout()) {
-          redirect_uri += '/__new';
-        }
-
         var authorize_url = KeyService['githubTriggerAuthorizeUrl'];
         var client_id = KeyService['githubTriggerClientId'];