ocadotechnology / rapid-router

A Blockly and python based educational game aimed at students age 5-14.
https://www.codeforlife.education
Other
56 stars 61 forks source link

teachers with no school cannot save created levels #1627

Open evemartin opened 1 month ago

evemartin commented 1 month ago

If a teacher is not part of a school and attempts to save a created level, they get the following error and the level is not saved:

image.png

As evidenced by the GCP logs, this might be due to an inaccurate check in level_editor.py's save_level_for_editor which is meant to check whether the user is in a school or not but actually just checks whether the user is an independent or not:

image.png

To fix the bug, this if check will probably have to be changed.

Steps to reproduce the bug:

  1. Log in as a teacher with no school
  2. Go straight to the Rapid Router Level Editor without adding a school
  3. Create a valid level and attempt to save it
  4. The error shown above should appear