Skip to content

Commit

Permalink
Merge pull request #9931 from internetarchive/fix-star-rating-null-cases
Browse files Browse the repository at this point in the history
hotfix search star ratings null case
  • Loading branch information
jimchamp authored Oct 3, 2024
2 parents 0ff9050 + 24456e7 commit 50350d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openlibrary/macros/StarRatingsStats.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
$ stats_by_bookshelf = work and work.get_num_users_by_bookshelf() or {}
$ ratings_average = rating_stats.get('avg_rating', None)
$ ratings_count = rating_stats.get('num_ratings', None)
$ want_to_read_count = "{:,}".format(stats_by_bookshelf.get('want-to-read', None))
$ currently_reading_count = "{:,}".format(stats_by_bookshelf.get('currently-reading', None))
$ already_read_count = "{:,}".format(stats_by_bookshelf.get('already-read', None))
$ want_to_read_count = stats_by_bookshelf.get('want-to-read') and "{:,}".format(stats_by_bookshelf['want-to-read'])
$ currently_reading_count = stats_by_bookshelf.get('currently-reading') and "{:,}".format(stats_by_bookshelf['currently-reading'])
$ already_read_count = stats_by_bookshelf.get('already-read') and "{:,}".format(stats_by_bookshelf['already-read'])
$ review_count_class = 'readers-stats__review-count--none' if ratings_count == None else ''
$ id = '--mobile' if mobile else ''

Expand Down

0 comments on commit 50350d0

Please sign in to comment.