Fix a display bug for tests that look like sha commits

This commit is contained in:
andrew committed 2023-09-25 17:40:26 -04:00
1 parent 7334ae4091
commit 9c95b60c25
2 files changed
+2 -7

No files matched your search

+1 -6
View File
@@ -132,7 +132,7 @@ def insertCommas(value):
return '{:,}'.format(int(value))
def prettyName(name):
if re.search('[0-9a-fA-F]{40}', name):
if re.search('^[0-9a-fA-F]{40}$', name):
return name[:16].upper()
return name
@@ -336,8 +336,3 @@ register.filter('network_download_link', network_download_link)
register.filter('workload_url', workload_url)
register.filter('workload_pretty_name', workload_pretty_name)
+1 -1
View File
@@ -285,7 +285,7 @@ def collect_github_info(errors, request, field):
# Get branch name / commit sha / tag, and the API path for it
branch = request.POST['{0}_branch'.format(field)]
bysha = bool(re.search('[0-9a-fA-F]{40}', branch))
bysha = bool(re.search('^[0-9a-fA-F]{40}$', branch))
# All API requests will share this common path. Some engines are private.
base = request.POST['%s_repo' % (field)].replace('github.com', 'api.github.com/repos')