@@ -61,7 +61,7 @@ def get(self, attachment_id: str, session: Optional[ClientSession] = None) -> Op
6161 :raises InvalidObjectIdError: If the supplied `attachment_id` is invalid.
6262 """
6363
64- logger .info ("Retrieving attachment with ID: %s from the database" , attachment_id )
64+ logger .info ("Retrieving attachment with ID '%s' from the database" , attachment_id )
6565
6666 try :
6767 attachment_id = CustomObjectId (attachment_id )
@@ -73,7 +73,7 @@ def get(self, attachment_id: str, session: Optional[ClientSession] = None) -> Op
7373
7474 if attachment :
7575 return AttachmentOut (** attachment )
76- raise MissingRecordError (detail = f"No attachment found with ID: { attachment_id } " , entity_type = "attachment" )
76+ raise MissingRecordError (detail = f"No attachment found with ID ' { attachment_id } ' " , entity_type = "attachment" )
7777
7878 def list (self , entity_id : Optional [str ], session : Optional [ClientSession ] = None ) -> list [AttachmentOut ]:
7979 """
@@ -128,7 +128,7 @@ def update(self, attachment_id: str, attachment: AttachmentIn, session: ClientSe
128128 exc .response_detail = "Attachment not found"
129129 raise exc
130130
131- logger .info ("Updating attachment metadata with ID: %s " , attachment_id )
131+ logger .info ("Updating attachment metadata with ID '%s' " , attachment_id )
132132 try :
133133 self ._attachments_collection .update_one (
134134 {"_id" : attachment_id }, {"$set" : attachment .model_dump (by_alias = True )}, session = session
@@ -149,7 +149,7 @@ def delete(self, attachment_id: str, session: Optional[ClientSession] = None) ->
149149 :raises MissingRecordError: If the supplied `attachment_id` is non-existent.
150150 :raises InvalidObjectIdError: If the supplied `attachment_id` is invalid.
151151 """
152- logger .info ("Deleting attachment with ID: %s from the database" , attachment_id )
152+ logger .info ("Deleting attachment with ID '%s' from the database" , attachment_id )
153153 try :
154154 attachment_id = CustomObjectId (attachment_id )
155155 except InvalidObjectIdError as exc :
@@ -158,7 +158,7 @@ def delete(self, attachment_id: str, session: Optional[ClientSession] = None) ->
158158 raise exc
159159 response = self ._attachments_collection .delete_one (filter = {"_id" : attachment_id }, session = session )
160160 if response .deleted_count == 0 :
161- raise MissingRecordError (f"No attachment found with ID: { attachment_id } " , entity_type = "attachment" )
161+ raise MissingRecordError (f"No attachment found with ID ' { attachment_id } ' " , entity_type = "attachment" )
162162
163163 def delete_by_entity_id (self , entity_id : str , session : Optional [ClientSession ] = None ) -> None :
164164 """
@@ -167,7 +167,7 @@ def delete_by_entity_id(self, entity_id: str, session: Optional[ClientSession] =
167167 :param entity_id: The entity ID of the attachments to delete.
168168 :param session: PyMongo ClientSession to use for database operations.
169169 """
170- logger .info ("Deleting attachments with entity ID: %s from the database" , entity_id )
170+ logger .info ("Deleting attachments with entity ID '%s' from the database" , entity_id )
171171 try :
172172 entity_id = CustomObjectId (entity_id )
173173 # Given it is deleting multiple, we are not raising an exception if no attachments were found to be deleted
@@ -184,7 +184,7 @@ def count_by_entity_id(self, entity_id: str, session: Optional[ClientSession] =
184184 :param entity_id: The entity ID to use to select which documents to count.
185185 :param session: PyMongo ClientSession to use for database operations.
186186 """
187- logger .info ("Counting number of attachments with entity ID: %s in the database" , str (entity_id ))
187+ logger .info ("Counting number of attachments with entity ID '%s' in the database" , str (entity_id ))
188188 return self ._attachments_collection .count_documents (
189189 filter = {"entity_id" : CustomObjectId (entity_id )}, session = session
190190 )
0 commit comments