add protection for error document
This commit is contained in:
+3
-2
@@ -62,8 +62,9 @@ class DataManager:
|
|||||||
doc_ref = self._db.collection(document_name).document(result.id)
|
doc_ref = self._db.collection(document_name).document(result.id)
|
||||||
doc_ref.set(result.to_firestore_dict())
|
doc_ref.set(result.to_firestore_dict())
|
||||||
else:
|
else:
|
||||||
doc_ref = self._db.collection(ERROR_COLLECTION_NAME).document(result.phone)
|
if len(result.phone) > 0:
|
||||||
doc_ref.set(result.to_firestore_dict())
|
doc_ref = self._db.collection(ERROR_COLLECTION_NAME).document(result.phone)
|
||||||
|
doc_ref.set(result.to_firestore_dict())
|
||||||
|
|
||||||
def save_timeout_contact(self, contact: ContactPojo):
|
def save_timeout_contact(self, contact: ContactPojo):
|
||||||
doc_ref = self._db.collection(TIMEOUT).document(str(contact.phone))
|
doc_ref = self._db.collection(TIMEOUT).document(str(contact.phone))
|
||||||
|
|||||||
Reference in New Issue
Block a user