Handle none values from config

main
Bob Mottram 2020-05-27 11:30:40 +01:00
parent 28ba4d080b
commit 0a3188a5da
2 changed files with 31 additions and 13 deletions

View File

@ -2934,9 +2934,12 @@ class PubServer(BaseHTTPRequestHandler):
self.path, self.server.domain, self.path, self.server.domain,
self.server.port, self.server.port,
self.server.httpPrefix).encode() self.server.httpPrefix).encode()
self._set_headers('text/html', len(msg), if msg:
cookie, callingDomain) self._set_headers('text/html', len(msg),
self._write(msg) cookie, callingDomain)
self._write(msg)
else:
self._404()
self.server.GETbusy = False self.server.GETbusy = False
return return

View File

@ -1098,22 +1098,37 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
instanceStr += \ instanceStr += \
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Instance Title'] + '</label>' translate['Instance Title'] + '</label>'
instanceStr += \ if instanceTitle:
' <input type="text" name="instanceTitle" value="' + \ instanceStr += \
instanceTitle + '"><br>' ' <input type="text" name="instanceTitle" value="' + \
instanceTitle + '"><br>'
else:
instanceStr += \
' <input type="text" name="instanceTitle" value=""><br>'
instanceStr += \ instanceStr += \
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Instance Short Description'] + '</label>' translate['Instance Short Description'] + '</label>'
instanceStr += \ if instanceDescriptionShort:
' <input type="text" name="instanceDescriptionShort" value="' + \ instanceStr += \
instanceDescriptionShort + '"><br>' ' <input type="text" ' + \
'name="instanceDescriptionShort" value="' + \
instanceDescriptionShort + '"><br>'
else:
instanceStr += \
' <input type="text" ' + \
'name="instanceDescriptionShort" value=""><br>'
instanceStr += \ instanceStr += \
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Instance Description'] + '</label>' translate['Instance Description'] + '</label>'
instanceStr += \ if instanceDescription:
' <textarea id="message" name="instanceDescription" ' + \ instanceStr += \
'style="height:200px">' + \ ' <textarea id="message" name="instanceDescription" ' + \
instanceDescription + '</textarea>' 'style="height:200px">' + \
instanceDescription + '</textarea>'
else:
instanceStr += \
' <textarea id="message" name="instanceDescription" ' + \
'style="height:200px"></textarea>'
instanceStr += \ instanceStr += \
' <label class="labels">' + \ ' <label class="labels">' + \
translate['Instance Logo'] + '</label>' translate['Instance Logo'] + '</label>'