git ssb

0+

Grey the earthling / scuttleblog



Commit 280029273cb8a3ad87628f4959116723aeab2681

Only insert user profile data if it exists

Users may not have a name or description.
Greg K Nicholson committed on 10/15/2017, 1:16:21 PM
Parent: 87a38977d66c2c45e62e7e26637ac063bd217ee4

Files changed

scuttleblog.pychanged
scuttleblog.pyView
@@ -98,12 +98,14 @@
9898 return user_metadata
9999
100100 def build_hugo_config(m):
101101 hugo_config = {}
102- hugo_config['title'] = m['value']['content']['name']
102 + if 'name' in m['value']['content']:
103 + hugo_config['title'] = m['value']['content']['name']
103104 hugo_config['theme'] = conf.hugo_theme
104105 hugo_config['params'] = {}
105- hugo_config['params']['subtitle'] = m['value']['content']['description'].replace('\n', ' ')
106 + if 'description' in m['value']['content']:
107 + hugo_config['params']['subtitle'] = m['value']['content']['description'].replace('\n', ' ')
106108 return (hugo_config)
107109
108110 def write_hugo_config_from_user(userid):
109111 metadata = get_user_metadata(userid)

Built with git-ssb-web