make type nullable

This commit is contained in:
2022-09-08 18:45:46 +02:00
parent 5a9dbcc174
commit 103b6cf14d
+11 -9
View File
@@ -17,14 +17,14 @@ class PublishType(Enum):
@dataclass_json
@dataclass
class ReserveResultPojo:
type: PublishType
phone: str
message: str
url: str
firstName: Union[None, str]
lastName: Union[None, str]
email: Union[None, str]
id = None
type: PublishType = PublishType.ERROR
phone: str = ""
message: str = ""
url: str = ""
firstName: Union[None, str] = ""
lastName: Union[None, str] = ""
email: Union[None, str] = ""
id: str = ""
accepted = None
passport: str = ""
slot_position = None
@@ -36,11 +36,13 @@ class ReserveResultPojo:
@staticmethod
def from_firestore_dict(source):
publish_type = PublishType.ERROR
if 'type' in source:
publish_type = source['type']
if publish_type:
publish_type = PublishType[publish_type]
phone = source['phone']
message = source['message']
message =""
url = source['url']
id = source['id']
email = source['email']