Skip to content

Commit

Permalink
[FIX] Admin classes page throws 500 (hedyorg#3276)
Browse files Browse the repository at this point in the history
`get_many(..., sort_key=)` was still being passed in a couple of places.

Remove them.
  • Loading branch information
rix0rrr authored Sep 13, 2022
1 parent c7b2342 commit 9743bae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def get_quiz_stats(self, ids, start=None, end=None):
start_week = self.to_year_week(self.parse_date(start, date(2022, 1, 1)))
end_week = self.to_year_week(self.parse_date(end, date.today()))

data = [QUIZ_STATS.get_many({'id': i, 'week': dynamo.Between(start_week, end_week)}, sort_key='week') for i in ids]
data = [QUIZ_STATS.get_many({'id': i, 'week': dynamo.Between(start_week, end_week)}) for i in ids]
return functools.reduce(operator.iconcat, data, [])

def add_program_stats(self, id, level, exception):
Expand All @@ -619,7 +619,7 @@ def get_program_stats(self, ids, start=None, end=None):
start_week = self.to_year_week(self.parse_date(start, date(2022, 1, 1)))
end_week = self.to_year_week(self.parse_date(end, date.today()))

data = [PROGRAM_STATS.get_many({'id': i, 'week': dynamo.Between(start_week, end_week)}, sort_key='week') for i in ids]
data = [PROGRAM_STATS.get_many({'id': i, 'week': dynamo.Between(start_week, end_week)}) for i in ids]
return functools.reduce(operator.iconcat, data, [])

def parse_date(self, d, default):
Expand Down

0 comments on commit 9743bae

Please sign in to comment.