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.server.port,
self.server.httpPrefix).encode()
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
if msg:
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
else:
self._404()
self.server.GETbusy = False
return

View File

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