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()
if msg:
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
self._write(msg) 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>'
if instanceTitle:
instanceStr += \ instanceStr += \
' <input type="text" name="instanceTitle" value="' + \ ' <input type="text" name="instanceTitle" value="' + \
instanceTitle + '"><br>' 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>'
if instanceDescriptionShort:
instanceStr += \ instanceStr += \
' <input type="text" name="instanceDescriptionShort" value="' + \ ' <input type="text" ' + \
'name="instanceDescriptionShort" value="' + \
instanceDescriptionShort + '"><br>' 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>'
if instanceDescription:
instanceStr += \ instanceStr += \
' <textarea id="message" name="instanceDescription" ' + \ ' <textarea id="message" name="instanceDescription" ' + \
'style="height:200px">' + \ 'style="height:200px">' + \
instanceDescription + '</textarea>' 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>'