Skip to content
Snippets Groups Projects
Commit 1bcc856e authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[MERGE] forward port branch 9.0 up to 04508683

parents 3579bd53 04508683
Branches
Tags
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment