redirect ac-discovery=1 to the index

This is a temp fix because rkt doesn't follow redirects.
This commit is contained in:
Jimmy Zelinskie 2015-04-30 13:03:50 -04:00
parent 6673d90818
commit ded28f6b30

View file

@ -527,6 +527,9 @@ def redirect_to_repository(namespace, reponame, tag):
permission = ReadRepositoryPermission(namespace, reponame)
is_public = model.repository_is_public(namespace, reponame)
if request.args.get('ac-discovery', 0) == 1:
return index('')
if permission.can() or is_public:
repository_name = '/'.join([namespace, reponame])
return redirect(url_for('web.repository', path=repository_name, tag=tag))