valid the links with paris ip
This commit is contained in:
+7
-2
@@ -1,7 +1,9 @@
|
||||
class LinkPojo():
|
||||
def __init__(self, url, email, updated_at, ip_country):
|
||||
def __init__(self, url, email, model, serial, updated_at, ip_country):
|
||||
self.url = url
|
||||
self.email = email
|
||||
self.model = model
|
||||
self.serial = serial
|
||||
self.updated_at = updated_at
|
||||
self.ip_country = ip_country
|
||||
|
||||
@@ -9,9 +11,12 @@ class LinkPojo():
|
||||
def from_firestore_dict(source):
|
||||
updated_at = source['updated_at']
|
||||
email = source['email']
|
||||
model = source['model']
|
||||
serial = source['serial']
|
||||
url = source['url']
|
||||
ip_country = "FR"
|
||||
if source.get('ip_country'):
|
||||
ip_country = source['ip_country']
|
||||
result = LinkPojo(email=email, url=url, updated_at=updated_at, ip_country=ip_country)
|
||||
result = LinkPojo(email=email, url=url, model=model, serial=serial, updated_at=updated_at,
|
||||
ip_country=ip_country)
|
||||
return result
|
||||
|
||||
@@ -13,6 +13,7 @@ class ContactPojo:
|
||||
store: str
|
||||
note: str
|
||||
ua: str
|
||||
serial: str
|
||||
|
||||
def __init__(self, phone_number: str, passport_number: str, last_name: str, first_name: str, mail: str,
|
||||
ccid: str = "",
|
||||
@@ -38,6 +39,7 @@ class ContactPojo:
|
||||
u'store': self.store,
|
||||
u'ccid': self.ccid,
|
||||
u'position': self.position,
|
||||
u'serial': self.serial,
|
||||
u'current_ip': self.current_ip,
|
||||
u'ua': self.ua
|
||||
}
|
||||
@@ -52,9 +54,13 @@ class ContactPojo:
|
||||
last_name = source['last_name']
|
||||
first_name = source['first_name']
|
||||
ip_country = "FR"
|
||||
|
||||
if source.get('ip_country'):
|
||||
ip_country = source['ip_country']
|
||||
result = ContactPojo(phone_number=phone, passport_number=passport, mail=email,
|
||||
last_name=last_name, first_name=first_name)
|
||||
result.ip_country = ip_country
|
||||
if source.get('serial'):
|
||||
serial = source['serial']
|
||||
result.serial = serial
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user