Fix errors in license compliance dialog

This commit is contained in:
Raphael Michel
2021-04-26 12:23:41 +02:00
parent 9f9d18b17f
commit 2cd67d6036
2 changed files with 5 additions and 2 deletions

View File

@@ -36,4 +36,4 @@ def get_source(request):
n = d.get('source_notice', '')
return render(request, 'source.html', {'notice': n})
else:
raise Http404(f'Not used under AGPL ({d["base_license"]})')
raise Http404(f'Not used under AGPL ({d.get("base_license")})')

View File

@@ -134,7 +134,10 @@ class LicenseCheckView(StaffMemberRequiredMixin, FormView):
seen = set()
for entry_point in pkg_resources.iter_entry_points(group='pretix.plugin', name=None):
if entry_point.dist.key not in seen:
license, url = self._get_license_for_pkg(entry_point.dist.key)
try:
license, url = self._get_license_for_pkg(entry_point.dist.key)
except FileNotFoundError:
license, url = '?', '?'
d['source_notice'] += f'\n{entry_point.dist.key} ({license}): {url}'
seen.add(entry_point.dist.key)