Skip to content

Commit

Permalink
Default end_date in PromotionWeights.bid_history
Browse files Browse the repository at this point in the history
Makes the behavior match that of PromoteDates.bid_history, which sets the
end_date to today if it's not given as a parameter.

This fixes a bug where the function raised an error if the optional parameter
end_date wasn't provided.
  • Loading branch information
shlurbee committed Jul 23, 2012
1 parent 9fa07d9 commit db5260f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions r2/r2/models/bidding.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,10 @@ def get_schedule(cls, start_date, end_date, author_id = None):
def bid_history(cls, start_date, end_date = None, account_id = None):
from r2.models import Link
from r2.lib import promote

if not end_date:
end_date = datetime.datetime.now(g.tz)

start_date = to_date(start_date)
end_date = to_date(end_date)
q = cls.query()
Expand Down

0 comments on commit db5260f

Please sign in to comment.