Generating cities dropdown when no city file exists

main
Bob Mottram 2021-07-19 21:05:20 +01:00
parent 3136f428d3
commit 8b5093eef4
1 changed files with 4 additions and 2 deletions

View File

@ -1485,6 +1485,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
translate['City for spoofed GPS image metadata'] + \
'</label><br>\n'
city = ''
cityFilename = acctDir(baseDir, nickname, domain) + '/city.txt'
if os.path.isfile(cityFilename):
with open(cityFilename, 'r') as fp:
@ -1505,8 +1506,9 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
citySelected = ''
cityName = cityName.split(':')[0]
cityName = cityName.lower()
if city in cityName:
citySelected = ' selected'
if city:
if city in cityName:
citySelected = ' selected'
editProfileForm += \
' <option value="' + cityName + \
'"' + citySelected.title() + '>' + \