From 0f5e8fdde75dadd508b77827d28158f5762fed0a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 11 2016 14:42:21 +0000 Subject: Move the logic around splitting the message head/body inside the python code --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index b354a35..789317a 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1261,11 +1261,18 @@ def get_git_tags_objects(project): objecttype = "commit" tags[commit_time] = { - "object":repo_obj[repo_obj.lookup_reference(tag).target], - "tagname":tag.replace("refs/tags/",""), - "date":commit_time, - "objecttype": objecttype - } + "object": repo_obj[repo_obj.lookup_reference(tag).target], + "tagname": tag.replace("refs/tags/",""), + "date": commit_time, + "objecttype": objecttype, + "head_msg": None, + "body_msg": None, + } + if objecttype == 'tag': + head_msg, _, body_msg = tags[commit_time][ + "object"].message.partition('\n') + tags[commit_time]["head_msg"] = head_msg + tags[commit_time]["body_msg"] = body_msg sorted_tags = [] for tag in sorted(tags, reverse=True): diff --git a/pagure/templates/releases.html b/pagure/templates/releases.html index 98da74d..2828925 100644 --- a/pagure/templates/releases.html +++ b/pagure/templates/releases.html @@ -44,12 +44,10 @@ {% if tag['objecttype'] == "tag" %} {% if tag['object'].message %} {{tag['tagname']}} - {% set msg_head_tail, _, detailtext = tag[ - 'object'].message.partition('\n') %} - {{ msg_head_tail }} - {% if msg_head_tail and detailtext.endswith( + {{ tag['head_msg'] }} + {% if tag['head_msg'] and tag['body_msg'].endswith( '\n-----END PGP SIGNATURE-----') %} - {% set detailtext = detailtext.rsplit( + {% set detailtext = tag['body_msg'].rsplit( '\n-----BEGIN PGP SIGNATURE-----', 1)[0] %} {% if detailtext %}