announcement_service_spec.yaml changes, removed logging from patchnotes_controller.py

This commit is contained in:
Justin Weins 2025-05-16 13:39:16 +02:00
parent c342a52465
commit 784f187d80
3 changed files with 2 additions and 12 deletions

View File

@ -113,7 +113,7 @@ components:
title: Patch note 1
changes: changes
version: 1.0.0
date: 2025-01-02
patch_date: 2025-01-02
properties:
patchID:
format: uuid

View File

@ -21,7 +21,6 @@ def patchnotes_date_get(date): # noqa: E501
:rtype: Union[List[PatchNotes], Tuple[List[PatchNotes], int], Tuple[List[PatchNotes], int, Dict[str, str]]
"""
logging.error(type(date))
try:
datetime.strptime(date, '%Y-%m-%d') # 2025-01-0
except ValueError as e:
@ -30,7 +29,6 @@ def patchnotes_date_get(date): # noqa: E501
detail="The date is invalid. Needs to be in this Format YYYY-MM-DD",
status=400,
)
logging.error('date:' + str(date))
query = {
'patch_date': {'$gte': date}
}
@ -57,7 +55,6 @@ def patchnotes_patch_iddelete(patch_id): # noqa: E501
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
"""
deleted_doc = collection.delete_one({'patchID': patch_id})
logging.error(deleted_doc.deleted_count)
if deleted_doc.deleted_count == 0:
raise ProblemException(
title="Not found",
@ -109,7 +106,6 @@ def patchnotes_patch_idput(patch_id, body): # noqa: E501
detail="No document has been deleted",
status=404,
)
logging.error(result)
return Response("Document was updated", status=200, mimetype='application/json')
@ -137,9 +133,6 @@ def patchnotes_post(body):
status=400,
)
logging.error('patch_notes_type:' + str(type(date_obj)))
logging.error('patch notes' + str(pn))
patch_note = {
'patchID': str(uuid.uuid4()),
'title': pn.title,
@ -148,9 +141,6 @@ def patchnotes_post(body):
'patch_date': date_str
}
logging.error('patch_notes_type:' + str(type(patch_note)))
logging.error('patch notes' + str(patch_note))
collection.insert_one(patch_note)
patch_note_obj = PatchNotes.from_dict(patch_note)
patch_note = patch_note_obj.to_dict()

View File

@ -126,7 +126,7 @@ components:
title: Patch note 1
changes: changes
version: 1.0.0
date: 2025-01-02
patch_date: 2025-01-02
properties:
patchID:
format: uuid