Browse Source
Merge pull request #262 from CompassionCH/10.0-sendgrid
Rewrite dependencies of sendgrid module fixes #261
pull/288/head
Pedro M. Baeza
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
14 additions and
7 deletions
-
.travis.yml
-
mail_sendgrid/__manifest__.py
-
mail_sendgrid/controllers/json_request.py
-
requirements.txt
|
|
@ -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 |
|
|
|
|
|
@ -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', |
|
|
@ -20,6 +20,6 @@ |
|
|
|
'installable': True, |
|
|
|
'auto_install': False, |
|
|
|
'external_dependencies': { |
|
|
|
'python': ['sendgrid'], |
|
|
|
'python': ['sendgrid', 'simplejson'], |
|
|
|
}, |
|
|
|
} |
|
|
@ -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): |
|
|
|
|
|
@ -1 +1,3 @@ |
|
|
|
premailer |
|
|
|
premailer |
|
|
|
simplejson |
|
|
|
sendgrid |