add method to fix phone number error
This commit is contained in:
@@ -10,17 +10,17 @@ class ContactPojo:
|
||||
last_name: str
|
||||
first_name: str
|
||||
mail: str
|
||||
note: str
|
||||
store: str
|
||||
ip_country: str
|
||||
|
||||
def __init__(self, phone_number: str, passport_number: str, last_name: str, first_name: str, mail: str,
|
||||
def __init__(self, phone_number: str, passport_number: str, last_name: str, first_name: str, mail: str, store: str,
|
||||
ip_country="FR"):
|
||||
self.phone = str(phone_number).replace(".0", "")
|
||||
self.passport = passport_number
|
||||
self.last_name = last_name
|
||||
self.first_name = first_name
|
||||
self.mail = mail
|
||||
self.note = ""
|
||||
self.store = store
|
||||
self.ip_country = ip_country
|
||||
|
||||
def to_firestore_dict(self):
|
||||
@@ -30,6 +30,7 @@ class ContactPojo:
|
||||
u'last_name': self.last_name,
|
||||
u'first_name': self.first_name,
|
||||
u'mail': self.mail,
|
||||
u'store': self.store,
|
||||
u'ip_country': self.ip_country
|
||||
}
|
||||
return dest
|
||||
@@ -47,10 +48,13 @@ class ContactPojo:
|
||||
email = source['mail']
|
||||
last_name = source['last_name']
|
||||
first_name = source['first_name']
|
||||
store = "random"
|
||||
if 'store' in source:
|
||||
store = source['store']
|
||||
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)
|
||||
last_name=last_name, first_name=first_name, store=store)
|
||||
result.ip_country = ip_country
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user