France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
1 stars 2 forks source link

Rework before_insert_items & before_update_items triggers #1153

Closed zenovich closed 1 month ago

zenovich commented 1 month ago
  1. Fix a bug in before_update_items causing new items with non-null url not matching any platform to have an unpredictable non-null platform_id. Update the related test.
  2. Get rid of session variables in before_insert_items & before_update_items triggers because
    • they are not needed there,
    • use of session variables may lead to unpredictable results when we forget to initialize them with values (like it was in clause 1.).
  3. Recalculate platform_id for all the items.
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (bcffaf5) to head (bbf3e2b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## testhelpers_emptyDB_stability #1153 +/- ## =============================================================== Coverage 100.00% 100.00% =============================================================== Files 238 238 Lines 14542 14542 =============================================================== Hits 14542 14542 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.