Skip to content

Commit

Permalink
catch empty list (#4444)
Browse files Browse the repository at this point in the history
  • Loading branch information
Felienne authored Sep 1, 2023
1 parent a4bf3c0 commit fb7f0c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/for_teachers.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def get_class_info(self, user, class_id):
customizations['sorted_adventures'][str(level)].append(
{"name": adventure, "from_teacher": False})
self.db.update_class_customizations(customizations)
min_level = min(customizations['levels'])
min_level = 1 if customizations['levels'] == [] else min(customizations['levels'])
else:
# Since it doesn't have customizations loaded, we create a default customization object.
# This makes further updating with HTMX easier
Expand Down

0 comments on commit fb7f0c0

Please sign in to comment.