Mitchell Admin
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
11 additions and
4 deletions
-
.isort.cfg
-
mail_private/tests/test_js.py
-
mailgun/models/ir_config_parameter.py
|
|
@ -9,4 +9,4 @@ line_length=88 |
|
|
|
known_odoo=odoo |
|
|
|
known_odoo_addons=odoo.addons |
|
|
|
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER |
|
|
|
known_third_party=requests,simplejson |
|
|
|
known_third_party=requests |
|
|
@ -22,7 +22,9 @@ class TestUi(odoo.tests.HttpCase): |
|
|
|
|
|
|
|
env = Environment(self.registry.test_cr, self.uid, {}) |
|
|
|
partners = env["res.partner"].search([]) |
|
|
|
new_follower = env["res.partner"].search([("name", "ilike", "Ja")]) |
|
|
|
new_follower = env["res.partner"].search( |
|
|
|
[("name", "ilike", "Ja"), ("email", "!=", False)] |
|
|
|
) |
|
|
|
for partner in partners: |
|
|
|
partner.message_subscribe(new_follower.ids, []) |
|
|
|
|
|
|
|
|
|
@ -1,10 +1,15 @@ |
|
|
|
import logging |
|
|
|
|
|
|
|
import requests |
|
|
|
import simplejson |
|
|
|
|
|
|
|
from odoo import api, models |
|
|
|
|
|
|
|
try: |
|
|
|
import simplejson as json |
|
|
|
except ImportError: |
|
|
|
import json |
|
|
|
|
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
@ -23,6 +28,6 @@ class IrConfigParameter(models.Model): |
|
|
|
res = requests.put(url, auth=("api", api_key)) |
|
|
|
if ( |
|
|
|
res.status_code == 200 |
|
|
|
and simplejson.loads(res.text)["domain"]["state"] == "active" |
|
|
|
and json.loads(res.text)["domain"]["state"] == "active" |
|
|
|
): |
|
|
|
self.sudo().set_param("mailgun.verified", "1") |