improve app.py

This commit is contained in:
KF7EEL 2021-05-18 12:12:57 -07:00
parent 6ac2ffe091
commit dd0825c005

View File

@ -54,7 +54,7 @@ def get_ids(callsign):
id_list[i['id']] = '' id_list[i['id']] = ''
return str([id_list, f_name, l_name, city]) return str([id_list, f_name, l_name, city])
except: except:
return '' return str([{}, '', '', ''])
# Return string in NATO phonetics # Return string in NATO phonetics
@ -831,9 +831,9 @@ def create_app():
) )
db.session.add(user_role) db.session.add(user_role)
db.session.commit() db.session.commit()
content = 'Created user ' + str(request.form.get('username')) content = '''<p style="text-align: center;">Created user: <strong>''' + str(request.form.get('username')) + '''</strong></p>\n'''
else: elif User.query.filter(User.username == request.form.get('username')).first():
content = 'Created user ' + str(request.form.get('Error')) content = 'Existing user: ' + str(request.form.get('username') + '. New user not created.')
return render_template('flask_user_layout.html', markup_content = Markup(content)) return render_template('flask_user_layout.html', markup_content = Markup(content))