cerpus / Edlib

Edlib is an application for creating, sharing, storing and using rich interactive learning resources.
https://docs.edlib.com
GNU General Public License v3.0
40 stars 7 forks source link

Fix some migrations #2721

Closed emmachughes closed 3 months ago

emmachughes commented 3 months ago
  1. Remove creation of useless default user

    This creates a predictable password which would essentially function like a backdoor, except CA does not match passwords stored as MD5 hashes. Since the hash is not usable, creating this account has no purpose anyway.

  2. Don't invoke application code when inserting H5P option

    This invokes H5POptionObserver which then tries interacting with the cache, which might not be available at the time of running migrations. Additionally, migrations have to take the DB state up until the point it's ran into consideration, therefore it should not rely on application code which could change at any point.

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 68.24%. Comparing base (dc6c44f) to head (bd90834). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2721 +/- ## ========================================= Coverage 68.24% 68.24% + Complexity 2713 2712 -1 ========================================= Files 273 272 -1 Lines 11556 11554 -2 ========================================= - Hits 7886 7885 -1 + Misses 3670 3669 -1 ``` | [Components](https://app.codecov.io/gh/cerpus/Edlib/pull/2721/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cerpus) | Coverage Δ | | |---|---|---| | [contentauthor](https://app.codecov.io/gh/cerpus/Edlib/pull/2721/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cerpus) | `68.24% <100.00%> (+<0.01%)` | :arrow_up: |