make description in body optional

master
lub 5 years ago
parent 9c53eab12f
commit 7f031eef09

@ -55,20 +55,25 @@ def get_blog():
return blog
def get_body(post):
return (
post['title']+
"\n"+
post['description']+
"\n"+
post['url']
)
body = post['title']+"\n"
if post['description'] != '':
body += post['description']+"\n"
body += post['url']
return body
def get_formatted_body(post):
return (
'<a href="'+post['url']+'">'+
'<h5>'+post['title']+'</h5>'+
'</a>'+
'<p>'+post['description']+'</p>'
)
formatted_body = '<a href="'+post['url']+'">'
formatted_body += '<h5>'+post['title']+'</h5>'
formatted_body += '</a>'
if post['description'] != '':
formatted_body += '<p>'+post['description']+'</p>'
formatted_body += post['url']
return formatted_body
homeserver = environ['HOMESERVER_URL']

Loading…
Cancel
Save