[MERGE] forward port branch 9.0 up to 0450868391
This commit is contained in:
@@ -577,6 +577,7 @@ class MassMailing(models.Model):
|
||||
'mass_mailing_id': mailing.id,
|
||||
'mailing_list_ids': [(4, l.id) for l in mailing.contact_list_ids],
|
||||
'no_auto_thread': mailing.reply_to_mode != 'thread',
|
||||
'template_id': None,
|
||||
}
|
||||
if mailing.reply_to_mode == 'email':
|
||||
composer_values['reply_to'] = mailing.reply_to
|
||||
|
||||
@@ -50,10 +50,10 @@ class GeoIPResolver(object):
|
||||
# Compatibility with Legacy database.
|
||||
# Some ips cannot be located to a specific country. Legacy DB used to locate them in
|
||||
# continent instead of country. Do the same to not change behavior of existing code.
|
||||
country = r.country if r.country.geoname_id else r.continent
|
||||
country, attr = (r.country, 'iso_code') if r.country.geoname_id else (r.continent, 'code')
|
||||
return {
|
||||
'city': r.city.name,
|
||||
'country_code': country.iso_code,
|
||||
'country_code': getattr(country, attr),
|
||||
'country_name': country.name,
|
||||
'region': r.subdivisions[0].iso_code if r.subdivisions else None,
|
||||
'time_zone': r.location.time_zone,
|
||||
|
||||
Reference in New Issue
Block a user