diff --git a/notification-manager/notification_api/dao/models/FOIRequestComments.py b/notification-manager/notification_api/dao/models/FOIRequestComments.py index 72fdfcd46..352932406 100644 --- a/notification-manager/notification_api/dao/models/FOIRequestComments.py +++ b/notification-manager/notification_api/dao/models/FOIRequestComments.py @@ -34,7 +34,7 @@ def savecomment(cls, commenttypeid, foirequestcomment, userid, createdat): conn = getconnection() cursor = conn.cursor() - + cursor.execute('INSERT INTO public."FOIRequestComments" (parentcommentid, ministryrequestid, "version", commenttypeid, \ comment, taggedusers, isactive, createdby, created_at, commentsversion) \ VALUES(%s::integer,%s::integer, %s::integer, %s::integer,%s,%s,%s::boolean,%s,%s,%s::integer) RETURNING commentid', @@ -50,4 +50,4 @@ def savecomment(cls, commenttypeid, foirequestcomment, userid, createdat): if conn: conn.close() - \ No newline at end of file + diff --git a/notification-manager/notification_api/services/commentservice.py b/notification-manager/notification_api/services/commentservice.py index 0d8195353..c6fe89ede 100644 --- a/notification-manager/notification_api/services/commentservice.py +++ b/notification-manager/notification_api/services/commentservice.py @@ -16,7 +16,7 @@ class commentservice: """ - def createcomment(self, requesttype, requestid, comment, userid, type=1, createdat=datetime.now()): + def createcomment(self, requesttype, requestid, comment, userid, type=1, createdat=None): foirequest = self.getrequest(requestid, requesttype) _comment = self.__preparecomment(foirequest, comment) FOIRequestComment().savecomment(type, _comment, userid, createdat) diff --git a/request-management-api/request_api/resources/foirequest.py b/request-management-api/request_api/resources/foirequest.py index 2cb7feadf..97f68e23a 100644 --- a/request-management-api/request_api/resources/foirequest.py +++ b/request-management-api/request_api/resources/foirequest.py @@ -33,6 +33,7 @@ from request_api.utils.enums import MinistryTeamWithKeycloackGroup import json import asyncio +import traceback API = Namespace('FOIRequests', description='Endpoints for FOI request management') TRACER = Tracer.get_instance() @@ -349,6 +350,7 @@ def get(ministryrequestid,usertype=None): except ValueError: return {'status': 500, 'message':"Invalid Request Id"}, 500 except KeyError as error: + traceback.print_exc() return {'status': False, 'message': CUSTOM_KEYERROR_MESSAGE + str(error)}, 400 except BusinessException as exception: - return {'status': exception.status_code, 'message':exception.message}, 500 \ No newline at end of file + return {'status': exception.status_code, 'message':exception.message}, 500