← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~stefan-therp/ocb-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain into lp:ocb-addons

 

Stefan Rijnhart (Therp) has proposed merging lp:~stefan-therp/ocb-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain into lp:ocb-addons.

Requested reviews:
  Lara (Therp) (lfreeke): test
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1311628 in OpenERP Community Backports (Addons): "Mail catchall domain parameter being reset by changing any general setting"
  https://bugs.launchpad.net/ocb-addons/+bug/1311628

For more details, see:
https://code.launchpad.net/~stefan-therp/ocb-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain/+merge/216877

Automatically derived from https://code.launchpad.net/~therp-nl/openobject-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain for https://code.launchpad.net/~openerp/openobject-addons/7.0. Below is a copy of the original description.

Don't overwrite an empty value for mail.catchall.domain. Pass a detectable default to get_param(). If this value returns, the key does not exist and we suggest the default value. Otherwise, keep the empty value of the existing key.
-- 
https://code.launchpad.net/~stefan-therp/ocb-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain/+merge/216877
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~stefan-therp/ocb-addons/7.0-lp1311628-dont_overwrite_empty_mail_catchall_domain into lp:ocb-addons.
=== modified file 'mail/res_config.py'
--- mail/res_config.py	2012-10-08 12:03:51 +0000
+++ mail/res_config.py	2014-04-23 13:15:53 +0000
@@ -33,14 +33,14 @@
     }
 
     def get_default_alias_domain(self, cr, uid, ids, context=None):
-        alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", context=context)
-        if not alias_domain:
+        alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", default=None, context=context)
+        if alias_domain is None:
             domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context)
             try:
                 alias_domain = urlparse.urlsplit(domain).netloc.split(':')[0]
             except Exception:
                 pass
-        return {'alias_domain': alias_domain}
+        return {'alias_domain': alias_domain or False}
 
     def set_alias_domain(self, cr, uid, ids, context=None):
         config_parameters = self.pool.get("ir.config_parameter")


References