Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Commit

Permalink
advertising: Fix display of cpm in platform blurb.
Browse files Browse the repository at this point in the history
Turns out calling 'min' on these doesn't work. I'm not really sure what it's doing.
Casting them to decimals first does the trick, though.  I'm 95% sure I checked this
before pushing it out, but maybe I'm just crazy.
  • Loading branch information
madbook committed Jan 12, 2015
1 parent 3f2c7be commit 7590a1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reddit_about/pages.py
Expand Up @@ -99,10 +99,10 @@ def __init__(self, *args, **kwargs):
blurbs = SelfServeBlurb.get_all(return_dict=True)
if 'platform' in blurbs:
min_cpm = min([
g.cpm_selfserve_collection,
g.cpm_selfserve,
g.cpm_selfserve_geotarget_metro,
]).decimal
g.cpm_selfserve_collection.decimal,
g.cpm_selfserve.decimal,
g.cpm_selfserve_geotarget_metro.decimal,
])
formatted_min_cpm = format_currency(min_cpm, 'USD', locale=c.locale)
formatted_min_bid = format_currency(g.min_promote_bid, 'USD', locale=c.locale)
blurbs['platform'].text = blurbs['platform'].text.replace(
Expand Down

0 comments on commit 7590a1e

Please sign in to comment.