remove mail->country check, too esoteric
This commit is contained in:
parent
879d114995
commit
b515feb456
1 changed files with 1 additions and 8 deletions
|
@ -69,19 +69,12 @@ class SessionData(models.Model):
|
||||||
self.location = u'%s, %s' % (city, country)
|
self.location = u'%s, %s' % (city, country)
|
||||||
self.location_sort = u'%s, %s' % (country, city)
|
self.location_sort = u'%s, %s' % (country, city)
|
||||||
else:
|
else:
|
||||||
self.location_sort = self.location = country
|
self.location_sort = self.location = country
|
||||||
else:
|
else:
|
||||||
self.location_sort = self.location = None
|
self.location_sort = self.location = None
|
||||||
except:
|
except:
|
||||||
self.location_sort = self.location = None
|
self.location_sort = self.location = None
|
||||||
pass
|
pass
|
||||||
if self.location == None and self.user and self.user.email:
|
|
||||||
tld = self.user.email.split('.')[-1]
|
|
||||||
if tld in ['edu', 'gov', 'mil']:
|
|
||||||
tld = 'us'
|
|
||||||
country = ox.get_country_name(tld)
|
|
||||||
if country:
|
|
||||||
self.location_sort = self.location = country
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if self.user:
|
if self.user:
|
||||||
|
|
Loading…
Reference in a new issue