diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py index 05d7ddc..f17b51c 100644 --- a/OpenBench/templatetags/mytags.py +++ b/OpenBench/templatetags/mytags.py @@ -1,3 +1,25 @@ +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # +# OpenBench is a chess engine testing framework authored by Andrew Grant. # +# # +# # +# OpenBench is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# OpenBench is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +import OpenBench.utils + from django import template from OpenBench.models import Test @@ -39,9 +61,9 @@ def gitDiffLink(test): devsha = test.dev.sha basesha = test.base.sha - repo = '/'.join(dev.split('/')[:-2]) - - return '{0}/compare/{1}...{2}'.format(repo, basesha[:8], devsha[:8]) + repo = OpenBench.utils.pathjoin(*dev.split('/')[:-2]) + return OpenBench.utils.pathjoin(repo, 'compare', + '{0}...{1}'.format(basesha[:8], devsha[:8])) def shortStatBlock(test): diff --git a/OpenBench/utils.py b/OpenBench/utils.py index d4c9a02..daa16ff 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -192,7 +192,8 @@ def getBranchInformation(repo, branch, errors): try: data = requests.get(target.rstrip('/')).json() treesha = data['commit']['commit']['tree']['sha'] - return (data['commit']['sha'], pathjoin(repo, 'archive', treesha, '.zip')) + source = pathjoin(repo, 'archive', treesha + '.zip').rstrip('/') + return (data['commit']['sha'], source) except: errors.append("Branch {0} could not be found".format(branch))