Skip to content

Commit

Permalink
fix: avoid runtime error when looking up for website
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk committed May 29, 2017
1 parent f194715 commit d4121fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mail_digest/models/mail_digest.py
Expand Up @@ -92,7 +92,11 @@ def _get_site_name(self):
# default to company
name = self.env.user.company_id.name
if 'website' in self.env:
ws = self.env['website'].get_current_website()
try:
ws = self.env['website'].get_current_website()
except RuntimeError:
# RuntimeError: object unbound -> no website request
ws = None
if ws:
name = ws.name
return name
Expand Down

0 comments on commit d4121fd

Please sign in to comment.