make description in body optional

master
lub 4 years ago
parent 9c53eab12f
commit 7f031eef09

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

Loading…
Cancel
Save