diff --git a/controllers/contract.py b/controllers/contract.py index de61676..9597648 100644 --- a/controllers/contract.py +++ b/controllers/contract.py @@ -27,7 +27,7 @@ def post(self) -> FlaskResponseType: helpers=data.get('helpers'), num_additional_chairs=data['numAdditionalChairs'], signer_email=current_cognito_jwt['email'], # TODO assert that emails are verified - signer_name=current_user, + signer_name=str(current_user), artist_phone_number=data['artistPhoneNumber'] ) except NoApproverException: diff --git a/controllers/me.py b/controllers/me.py index 5b1e6d7..aadf70d 100644 --- a/controllers/me.py +++ b/controllers/me.py @@ -13,7 +13,7 @@ class MeController(BaseController): @cognito_auth_required @swag_from("swagger/me/get.yaml") def get(self) -> FlaskResponseType: - result = MeManager().get_user(current_user, current_cognito_jwt) + result = MeManager().get_user(str(current_user), current_cognito_jwt) return FlaskResponses().success(result) @cognito_auth_required diff --git a/database/users.py b/database/users.py index f97b872..959062d 100644 --- a/database/users.py +++ b/database/users.py @@ -40,8 +40,8 @@ def get_collection_async(cls) -> AsyncIOMotorCollection: # type: ignore[no-any- return super().get_database_async()['users'] @classmethod - def add_user_contract(cls, uuid: str, contract_id: str) -> bool: - return cls.get_collection().updateOne( + def add_user_contract(cls, uuid: str, contract_id: str) -> pymongo.results.UpdateResult: + return cls.get_collection().update_one( {"_id": uuid}, {"$addToSet": {"contracts": contract_id}} ) diff --git a/services/docusign/contract_data.py b/services/docusign/contract_data.py index 6d85ffc..ae9b3b4 100644 --- a/services/docusign/contract_data.py +++ b/services/docusign/contract_data.py @@ -35,6 +35,8 @@ def generate_envelope(self) -> EnvelopeDefinition: # type: ignore[no-any-unimpo text_envelope_args.append(Text(tab_label=key, value=getattr(self, key))) elif type(getattr(self, key, None)) == int: number_envelope_args.append(Number(tab_label=key, value=getattr(self, key))) + else: + raise Exception(f"Invalid key data. '{key}' with value '{getattr(self, key, None)}' with type '{type(getattr(self, key, None))}' can only be a string or int") # Add helper badge information if (self.helpers):