mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 17:34:21 +01:00
adding more try catch for template debugging
This commit is contained in:
parent
819e575a28
commit
3a1966324d
@ -1051,6 +1051,7 @@ class LdapCherry(object):
|
|||||||
for r in self.roles.flatten:
|
for r in self.roles.flatten:
|
||||||
display_names[r] = self.roles.flatten[r]['display_name']
|
display_names[r] = self.roles.flatten[r]['display_name']
|
||||||
roles_js = json.dumps(display_names, separators=(',', ':'))
|
roles_js = json.dumps(display_names, separators=(',', ':'))
|
||||||
|
try:
|
||||||
form = self.temp['form.tmpl'].render(
|
form = self.temp['form.tmpl'].render(
|
||||||
attributes=self.attributes.attributes,
|
attributes=self.attributes.attributes,
|
||||||
values=None,
|
values=None,
|
||||||
@ -1071,6 +1072,10 @@ class LdapCherry(object):
|
|||||||
custom_js=self.custom_js,
|
custom_js=self.custom_js,
|
||||||
notifications=self._empty_notification(),
|
notifications=self._empty_notification(),
|
||||||
)
|
)
|
||||||
|
except NameError:
|
||||||
|
raise TemplateRenderError(
|
||||||
|
exceptions.text_error_template().render()
|
||||||
|
)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@exception_decorator
|
@exception_decorator
|
||||||
@ -1203,12 +1208,15 @@ class LdapCherry(object):
|
|||||||
"Self modification done"
|
"Self modification done"
|
||||||
)
|
)
|
||||||
user_attrs = self._get_user(user)
|
user_attrs = self._get_user(user)
|
||||||
|
|
||||||
|
try:
|
||||||
if user_attrs == {}:
|
if user_attrs == {}:
|
||||||
return self.temp['error.tmpl'].render(
|
return self.temp['error.tmpl'].render(
|
||||||
is_admin=is_admin,
|
is_admin=is_admin,
|
||||||
alert='warning',
|
alert='warning',
|
||||||
message="User doesn't exist"
|
message="User doesn't exist"
|
||||||
)
|
)
|
||||||
|
|
||||||
form = self.temp['form.tmpl'].render(
|
form = self.temp['form.tmpl'].render(
|
||||||
attributes=self.attributes.get_selfattributes(),
|
attributes=self.attributes.get_selfattributes(),
|
||||||
values=self._escape(user_attrs, 'attr_list'),
|
values=self._escape(user_attrs, 'attr_list'),
|
||||||
@ -1220,3 +1228,7 @@ class LdapCherry(object):
|
|||||||
is_admin=is_admin,
|
is_admin=is_admin,
|
||||||
notifications=self._empty_notification(),
|
notifications=self._empty_notification(),
|
||||||
)
|
)
|
||||||
|
except NameError:
|
||||||
|
raise TemplateRenderError(
|
||||||
|
exceptions.text_error_template().render()
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user