Skip to content

Commit

Permalink
fix: non school teachers can now save levels (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah-Bakr authored Jan 28, 2025
1 parent 4b847ce commit 7a110df
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions game/views/level_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,14 @@ def save_level_for_editor(request, levelId=None):

# share with all admins of the school if user is in a school
if not is_user_independent:
school_admins = teacher.school.admins()

[
level.shared_with.add(school_admin.new_user)
for school_admin in school_admins
if school_admin.new_user != request.user
]
if not teacher.school is None:
school_admins = teacher.school.admins()

[
level.shared_with.add(school_admin.new_user)
for school_admin in school_admins
if school_admin.new_user != request.user
]

level.save()
response = {"id": level.id}
Expand Down

0 comments on commit 7a110df

Please sign in to comment.