clean up python2 syntax

pull/1/head
radex 2023-09-23 11:23:28 +02:00
parent 78458f6211
commit 64d62692d4
3 changed files with 9 additions and 9 deletions

View File

@ -30,11 +30,11 @@ admin_pw = 'changeme'
# LDAP attribute configuration
readable_names = {
'commonname': u'Common Name',
'givenname': u'Given Name',
'gecos': u'GECOS (public name)',
'surname': u'Surname',
'loginshell': u'Shell',
'commonname': 'Common Name',
'givenname': 'Given Name',
'gecos': 'GECOS (public name)',
'surname': 'Surname',
'loginshell': 'Shell',
'telephonenumber': 'Phone Number',
'mobiletelephonenumber': 'Mobile Number',
'sshpublickey': 'SSH Public Key',

View File

@ -28,11 +28,11 @@ def _passwd_kadmin(current, new):
def passwd_action():
current, new, confirm = (flask.request.form[n] for n in ('current', 'new', 'confirm'))
if new != confirm:
flask.flash(u"New passwords don't match", category='danger')
flask.flash("New passwords don't match", category='danger')
return flask.render_template('passwd.html')
if _passwd_kadmin(current, new):
flask.flash(u'Password changed', category='info')
flask.flash('Password changed', category='info')
else:
flask.flash(u'Wrong password', category='danger')
flask.flash('Wrong password', category='danger')
return flask.render_template('passwd.html')

View File

@ -59,7 +59,7 @@ def attr_op(op, attrName, uid = None, success_redirect='/vcard',
if form.is_submitted():
for field, errors in form.errors.items():
for error in errors:
flask.flash(u"Error in the {} field - {}".format(
flask.flash("Error in the {} field - {}".format(
getattr(form, field).label.text,
error
), 'danger')