Skip to content

Commit

Permalink
Merge pull request #5476 from bcgov/test-rook
Browse files Browse the repository at this point in the history
fix date stamp inaccurate on response package comment issue
  • Loading branch information
nkan-aot2 authored Dec 12, 2024
2 parents 774fbda + d9e02d0 commit baff0a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -50,4 +50,4 @@ def savecomment(cls, commenttypeid, foirequestcomment, userid, createdat):
if conn:
conn.close()



Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion request-management-api/request_api/resources/foirequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
return {'status': exception.status_code, 'message':exception.message}, 500

0 comments on commit baff0a7

Please sign in to comment.