Skip to content

Commit

Permalink
[FIX] Grid page failing (#4417)
Browse files Browse the repository at this point in the history
Classes with old programs were failing because some of them did not have the field `adventure_name`. This PR adds an if when retrieving programs that have this characteristic. It also deletes the debug prints that were added in #4416.
  • Loading branch information
jpelay committed Aug 21, 2023
1 parent 8044443 commit e424fa3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions website/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ def get_grid_info(self, user, class_id, level):
ticked_adventures[student] = []
current_program = {}
for _, program in programs.items():
print('*'*100)
print(f'program {program} for student {student}')
print('*'*100)
# Old programs sometimes don't have adventures associated to them
# So skip them
if 'adventure_name' not in program:
continue
name = adventure_names.get(program['adventure_name'], program['adventure_name'])
customized_level = class_adventures_formatted.get(str(program['level']))
if name in customized_level:
Expand Down

0 comments on commit e424fa3

Please sign in to comment.