Merge branch 'master' into ackbar

This commit is contained in:
Joseph Schorr 2015-01-08 13:57:39 -05:00
commit 47fb10b79f
17 changed files with 167 additions and 52 deletions

View file

@ -21,7 +21,7 @@ from util.cache import no_cache
from endpoints.common import common_login, render_page_template, route_show_if, param_required
from endpoints.csrf import csrf_protect, generate_csrf_token, verify_csrf
from endpoints.registry import set_cache_headers
from util.names import parse_repository_name
from util.names import parse_repository_name, parse_repository_name_and_tag
from util.useremails import send_email_changed
from util.systemlogs import build_logs_archive
from auth import scopes
@ -165,7 +165,7 @@ def health():
check = HealthCheck.get_check(app.config['HEALTH_CHECKER'][0], app.config['HEALTH_CHECKER'][1])
(data, is_healthy) = check.conduct_healthcheck(db_healthy, buildlogs_healthy)
response = jsonify(dict(data = data, is_healthy = is_healthy))
response = jsonify(dict(data=data, is_healthy=is_healthy))
response.status_code = 200 if is_healthy else 503
return response
@ -227,14 +227,14 @@ def robots():
@web.route('/<path:repository>')
@no_cache
@process_oauth
@parse_repository_name
def redirect_to_repository(namespace, reponame):
@parse_repository_name_and_tag
def redirect_to_repository(namespace, reponame, tag):
permission = ReadRepositoryPermission(namespace, reponame)
is_public = model.repository_is_public(namespace, reponame)
if permission.can() or is_public:
repository_name = '/'.join([namespace, reponame])
return redirect(url_for('web.repository', path=repository_name))
return redirect(url_for('web.repository', path=repository_name, tag=tag))
abort(404)