diff options
| author | Jeremy Kersten <jke@odoo.com> | 2016-08-02 11:18:05 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2016-08-02 11:18:05 +0200 |
| commit | 944db71f21874d76c22aeb9c247fa4ecf079ca52 (patch) | |
| tree | 74a25129dad1f58433eb6205ed62ae9f88be18b1 /addons/website_event/controllers/main.py | |
| parent | a7fb3e0facdde25f61250e2a7eef01a299fc68fe (diff) | |
[FIX] website_event: fix get_formated_date to avoid traceback
Avoid AttributeError: 'WebsiteEventController (extended by WebsiteEventSa' object has no attribute 'env'
Self is the controller and not the event.
Diffstat (limited to 'addons/website_event/controllers/main.py')
| -rw-r--r-- | addons/website_event/controllers/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index 3c36524dbb1..8afc69a20ba 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -194,8 +194,8 @@ class WebsiteEventController(http.Controller): def get_formated_date(self, event): start_date = fields.Datetime.from_string(event.date_begin).date() end_date = fields.Datetime.from_string(event.date_end).date() - month = babel.dates.get_month_names('abbreviated', locale=self.env.context.get('lang', 'en_US'))[start_date.month] - return ('%s %s%s') % (month, start_date.strftime("%e"), (end_date != start_date and ("-"+end_date.strftime("%e")) or "")) + month = babel.dates.get_month_names('abbreviated', locale=event.env.context.get('lang', 'en_US'))[start_date.month] + return ('%s %s%s') % (month, start_date.strftime("%e"), (end_date != start_date and ("-" + end_date.strftime("%e")) or "")) @http.route('/event/get_country_event_list', type='http', auth='public', website=True) def get_country_events(self, **post): |
