Skip to content

Commit

Permalink
Fix use of bare Except blocking precommit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
odelaere committed Apr 14, 2020
1 parent 33da7eb commit 3507efc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/collective/documentgenerator/events/styles_events.py
Expand Up @@ -96,13 +96,11 @@ def _update_template_styles(pod_template, style_template_filename):
logger.error("Error is '%s'" % stderr)
portal = api.portal.get()
request = portal.REQUEST
try:
api.portal.show_message(message=_(u"Problem during styles update on template '${tmpl}': ${err}",
mapping={'tmpl': safe_unicode(pod_template.absolute_url_path()),
'err': safe_unicode(stderr)}),
request=request, type='error')
except:
pass
api.portal.show_message(message=_(u"Problem during styles update on template '${tmpl}': ${err}",
mapping={'tmpl': safe_unicode(pod_template.absolute_url_path()),
'err': safe_unicode(stderr)}),
request=request,
type='error')
raise Redirect(request.get('ACTUAL_URL'),
translate(_(u"Problem during styles update on template '${tmpl}': ${err}",
mapping={'tmpl': safe_unicode(pod_template.absolute_url_path()),
Expand Down
6 changes: 3 additions & 3 deletions src/collective/documentgenerator/helper/base.py
Expand Up @@ -200,10 +200,10 @@ def mailed_context(self, mailed_data):
for key in ('mailing_list', 'mailed_doc'):
if key in new_context:
del new_context[key]
except:
new_context['mailed_data'] = mailed_data
return new_context
except AttributeError: # in case one object is None starting with self.appy_renderer
return {'mailed_data': mailed_data}
new_context['mailed_data'] = mailed_data
return new_context

def do_mailing(self):
""" Check if mailing data must be replaced in template """
Expand Down

0 comments on commit 3507efc

Please sign in to comment.