Fix index out of range error in get_latest_tag

This commit is contained in:
rubenwardy 2021-01-30 23:41:31 +00:00
parent ede010c25d
commit 7c3d738756
2 changed files with 4 additions and 2 deletions

View File

@ -113,6 +113,7 @@ def get_latest_tag(git_url):
origin.fetch()
refs = repo.git.ls_remote(tags=True, sort="creatordate").split('\n')
refs = [ref for ref in refs if ref.strip() != ""]
if len(refs) == 0:
return None
@ -394,8 +395,6 @@ def check_update_config(self, package_id):
err = None
try:
check_update_config_impl(package)
except IndexError as e:
err = "Unable to find the reference.\n" + str(e)
except GitCommandError as e:
# This is needed to stop the backtrace being weird
err = e.stderr

View File

@ -57,6 +57,9 @@
<div class="mt-5"></div>
<a class="btn btn-secondary float-right" href="{{ url_for('todo.tags', author=user.username) }}">See All</a>
<h2>{{ _("Packages Without Tags") }}</h2>
<p>
Labelling your packages with tags helps users find them.
</p>
<div class="list-group mt-3 mb-5">
{% for package in needs_tags %}
<a class="list-group-item list-group-item-action" href="{{ package.getDetailsURL() }}">