Browse Source

fix flake8 issues

pull/336/head
Alexandre Fayolle 9 years ago
committed by Alexandre Fayolle
parent
commit
b2d1c14d02
  1. 10
      base_external_dbsource/base_external_dbsource.py
  2. 6
      super_calendar/models/super_calendar_configurator.py

10
base_external_dbsource/base_external_dbsource.py

@ -21,12 +21,17 @@
import os
import logging
import psycopg2
from openerp.osv import orm, fields
from openerp.tools.translate import _
import openerp.tools as tools
_logger = logging.getLogger(__name__)
CONNECTORS = [('postgresql', 'PostgreSQL')]
CONNECTORS = []
try:
import sqlalchemy
@ -62,9 +67,6 @@ except:
_logger.info('Oracle libraries not available. Please install "cx_Oracle"\
python package.')
import psycopg2
CONNECTORS.append(('postgresql', 'PostgreSQL'))
class base_external_dbsource(orm.Model):
_name = "base.external.dbsource"

6
super_calendar/models/super_calendar_configurator.py

@ -152,9 +152,9 @@ class SuperCalendarConfigurator(models.Model):
# Convert date_start to UTC timezone if it is a date field
# in order to be stored in UTC in the database
if line.date_start_field_id.ttype == 'date':
tz = timezone(self._context.get('tz')
or self.env.user.tz
or 'UTC')
tz = timezone(self._context.get('tz') or
self.env.user.tz or
'UTC')
local_date_start = tz.localize(date_start)
utc_date_start = local_date_start.astimezone(utc)
date_start = utc_date_start

Loading…
Cancel
Save