Skip to content

Commit

Permalink
Merge pull request #606 from terceiro/review-score
Browse files Browse the repository at this point in the history
Exclude NULLs from talk review score average (this is more sensible and matches the SQL average displayed in the admin interface).
  • Loading branch information
hodgestar committed Jul 6, 2021
2 parents 63f40f3 + 19cb402 commit 6b0cafe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wafer/talks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def is_late_submission(self):
@property
def review_score(self):
# Overridden in admin, to allow sorting
reviews = [review.avg_score for review in self.reviews.all() if review.avg_score]
reviews = [review.avg_score for review in self.reviews.all() if review.avg_score is not None]
if not reviews:
return None
return sum(reviews) / len(reviews)
Expand Down

0 comments on commit 6b0cafe

Please sign in to comment.