Let get_html_text do the variable substitutions
This commit is contained in:
parent
829e5b605a
commit
0ea869f0ba
|
@ -180,8 +180,7 @@ class RootDirectory(Directory):
|
|||
if certificates:
|
||||
vars['certificate_list'] = certificate_list
|
||||
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('account')), vars)
|
||||
return TextsDirectory.get_html_text('account', vars)
|
||||
|
||||
|
||||
def federations [html] (self):
|
||||
|
@ -213,8 +212,7 @@ class RootDirectory(Directory):
|
|||
'federations_list': str(self.get_idp_federations_list(identity))
|
||||
}
|
||||
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('federations')), vars)
|
||||
return TextsDirectory.get_html_text('federations', vars)
|
||||
|
||||
def get_idp_sso_list [html] (self):
|
||||
if not get_cfg('providers', {}).items():
|
||||
|
@ -349,8 +347,7 @@ class RootDirectory(Directory):
|
|||
vars = {
|
||||
'change_password_form': str(form.render())
|
||||
}
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('change_password')), vars)
|
||||
return TextsDirectory.get_html_text('change_password', vars)
|
||||
|
||||
def get_login_form(self,cancel=False):
|
||||
identities_cfg = get_cfg('identities', {})
|
||||
|
@ -392,7 +389,7 @@ class RootDirectory(Directory):
|
|||
raise errors.TraversalError()
|
||||
return self.login(allow_direct = False)
|
||||
|
||||
def login [html] (self, allow_direct = True): # only works with PasswordAccount for now
|
||||
def login(self, allow_direct = True): # only works with PasswordAccount for now
|
||||
request = get_request()
|
||||
# Already logged no login token (not a ForceAuthn login)
|
||||
if request.user is not None and (not get_field('LoginToken')
|
||||
|
@ -467,8 +464,7 @@ class RootDirectory(Directory):
|
|||
'creation_mode': identities_cfg.get('creation'),
|
||||
}
|
||||
get_request().form=save_form
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('login')), vars)
|
||||
return TextsDirectory.get_html_text('login', vars)
|
||||
|
||||
def login_ssl (self):
|
||||
request = get_request()
|
||||
|
@ -719,8 +715,7 @@ class RootDirectory(Directory):
|
|||
vars = {
|
||||
'register_form': str(form.render())
|
||||
}
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('register')), vars)
|
||||
return TextsDirectory.get_html_text('register', vars)
|
||||
|
||||
def register_submit(self, form):
|
||||
identities_cfg = get_cfg('identities', {})
|
||||
|
@ -849,8 +844,7 @@ class RootDirectory(Directory):
|
|||
template.html_top(_('Registration Completed'))
|
||||
get_response().breadcrumb.append( ('registration', _('Registration Completed')) )
|
||||
branding_cfg = get_cfg('branding', {})
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('register_completed')), {})
|
||||
return TextsDirectory.get_html_text('register_completed')
|
||||
|
||||
def email_password(self, identity, welcome = False, password = None):
|
||||
store = identities.get_store()
|
||||
|
@ -896,9 +890,7 @@ administrator'))
|
|||
|
||||
def forgot_password_message [html] (self):
|
||||
template.html_top(_('Lost Password'))
|
||||
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('lost_password_mailed')), vars)
|
||||
return TextsDirectory.get_html_text('lost_password_mailed')
|
||||
|
||||
def forgot_password_dumb_question [html] (self, form):
|
||||
identities_cfg = get_cfg('identities', {})
|
||||
|
@ -953,8 +945,7 @@ administrator'))
|
|||
'lost_password_question_form': str(form.render())
|
||||
}
|
||||
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('lost_password_question')), vars)
|
||||
return TextsDirectory.get_html_text('lost_password_question', vars)
|
||||
|
||||
|
||||
def forgot_password [html] (self):
|
||||
|
@ -992,8 +983,7 @@ administrator'))
|
|||
}
|
||||
|
||||
template.html_top(_('Lost Password'))
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('lost_password')), vars)
|
||||
return TextsDirectory.get_html_text('lost_password', vars)
|
||||
|
||||
|
||||
def forgot_password_submit(self, form):
|
||||
|
@ -1063,8 +1053,7 @@ administrator'))
|
|||
'info_form': str(form.render())
|
||||
}
|
||||
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('update_info')), vars)
|
||||
return TextsDirectory.get_html_text('update_info', vars)
|
||||
|
||||
|
||||
def update_info_submit(self, form, identity):
|
||||
|
@ -1105,8 +1094,7 @@ administrator'))
|
|||
'lost_identifier_form': str(form.render())
|
||||
}
|
||||
template.html_top(_('Lost Account Name'))
|
||||
return template.process_template(
|
||||
str(TextsDirectory.get_html_text('lost_identifier')), vars)
|
||||
return TextsDirectory.get_html_text('lost_identifier', vars)
|
||||
|
||||
def forgot_identifier_submit(self, form):
|
||||
email = form.get_widget('email').parse()
|
||||
|
|
Reference in New Issue