Skip to content

Commit

Permalink
Rewrite dependencies of sendgrid module fixes OCA#261
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Apr 19, 2018
1 parent c2087ac commit 4de4c4b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ virtualenv:
system_site_packages: true

install:
- pip install sendgrid
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
Expand Down
4 changes: 2 additions & 2 deletions mail_sendgrid/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2017 Compassion CH (http://www.compassion.ch)
# Copyright 2015-2018 Compassion CH (http://www.compassion.ch)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'SendGrid',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'category': 'Social Network',
'author': 'Compassion CH, Odoo Community Association (OCA)',
'license': 'AGPL-3',
Expand Down
10 changes: 8 additions & 2 deletions mail_sendgrid/controllers/json_request.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2017 Compassion CH (http://www.compassion.ch)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import simplejson

import logging
from odoo.http import JsonRequest, Root, Response

# Monkeypatch type of request rooter to use RESTJsonRequest
old_get_request = Root.get_request
_logger = logging.getLogger(__name__)

try:
import simplejson
except ImportError:
_logger.error("Please install simplejson tu use mail_sendgrid module")
_logger.debug("ImportError details:", exc_info=True)


def get_request(self, httprequest):
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
premailer
premailer
simplejson
sendgrid

0 comments on commit 4de4c4b

Please sign in to comment.