From 7daa8812aa522252f4959f47511dbd3be86ed60e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Jan 2023 15:09:40 +0000 Subject: [PATCH] Support alternative license representation --- webapp_post.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webapp_post.py b/webapp_post.py index 65d387ba3..6f332ca61 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1795,7 +1795,15 @@ def _get_content_license(post_json_object: {}) -> str: """Returns the content license for the given post """ if not post_json_object['object'].get('attachment'): - return None + if not post_json_object['object'].get('schema:license'): + return None + + if post_json_object['object'].get('schema:license'): + value = post_json_object['object']['schema:license'] + if '://' not in value: + value = license_link_from_name(value) + return value + for item in post_json_object['object']['attachment']: if not item.get('name'): continue