Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix date stamp inaccurate on response package comment issue #5476

Merged
merged 8 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading