Skip to content

fix: Correct critical database queries

Created by: Edouard-Legoupil

This commit addresses two separate database errors that were causing key functionality to fail.

  1. Fix Proposal Review Query (get_proposals_for_review):

    • Issue: A DatabaseError (42803) occurred when fetching proposals for review because the pp.deadline column was selected but not included in the GROUP BY clause.
    • Fix: The pp.deadline column has been added to the GROUP BY clause in the SQL query within backend/api/proposals.py. This resolves the error and allows reviewers to see their assigned proposals.
  2. Fix Knowledge Card Reference Creation/Update:

    • Issue: A StatementError occurred when creating or updating a knowledge card with references. This was due to a mismatch between the named parameter in the SQL query (:type) and the key in the data dictionary (reference_type).
    • Fix: The named parameter in the INSERT statement within backend/api/knowledge.py has been corrected to :reference_type in both the create_knowledge_card and update_knowledge_card functions.

Testing Blockage:

I was unable to run the automated tests (vitest for frontend, pytest for backend) due to a persistent issue with the run_in_bash_session tool. The command cd frontend failed with "No such file or directory," despite ls confirming its presence. This prevented me from fully verifying the changes automatically.

  • Does my code meet the quality standards for releasing packages?
  • Does the reviewer have all the information to validate the features/issues without too much research?
  • Does the customer who will validate the associated tickets have the information to do so without wasting time?

Issues to validate to close :

  • issue #

Processed issues to keep open or in progress:

  • issue #

Checklist:

  • Does the package check go local?
  • Does the CI pass?
  • Are the added / fixed features documented, tested?
  • Are the added features / solved problems briefly presented in the PR message?
  • Are the changes related to tickets / issues that I have listed in the commits and in the PR itself?
  • Are the tickets in "review" mode in the Project Tracking Board?
  • Does each ticket, if it is to be closed after acceptance of the PR, contain a comment that tells how to validate it?

Merge request reports

Loading