Skip to content
Snippets Groups Projects
Verified Commit 7f107305 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Inject licence URLs into licence dicts

parent dba534f4
No related branches found
No related tags found
1 merge request!146Resolve "Add licence information page"
Pipeline #1518 failed
......@@ -76,7 +76,13 @@ class AppConfig(django.apps.AppConfig):
parsed = licensing.parse(licence).simplify()
readable = parsed.render_as_readable()
licence_dicts = [LICENSES.get(symbol.key, default_dict) for symbol in parsed.symbols]
for symbol in parsed.symbols:
licence_dict = LICENSES.get(symbol.key, None)
if licence_dict is None:
licence_dict = default_dict
else:
licence_dict["url"] = "https://spdx.org/licenses/{}.html".format(licence_dict["licenseId"])
return (readable, licence_dicts)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment