From a3153d61dd89d83f29ec4840ad7e2e13c9359494 Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Thu, 6 Feb 2014 16:12:09 -0500 Subject: [PATCH] Make advertisers and sponsors have same start date restrictions. --- r2/r2/controllers/promotecontroller.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/r2/r2/controllers/promotecontroller.py b/r2/r2/controllers/promotecontroller.py index d6bbe4b01..3c8fc9e1d 100644 --- a/r2/r2/controllers/promotecontroller.py +++ b/r2/r2/controllers/promotecontroller.py @@ -565,7 +565,7 @@ class PromoteController(ListingController): @validatedForm(VSponsor('link_id36'), VModhash(), dates=VDateRange(['startdate', 'enddate'], - earliest=timedelta(days=1), + earliest=timedelta(days=g.min_promote_future), latest=timedelta(days=g.max_promote_future), reference_date=promote.promo_datetime_now, business_days=True, @@ -590,21 +590,6 @@ class PromoteController(ListingController): if location: cpm += g.cpm_selfserve_geotarget.pennies - if (start and end and not promote.is_accepted(link) and - not c.user_is_sponsor): - # if the ad is not approved already, ensure the start date - # is at least 2 days in the future - start = start.date() - end = end.date() - now = promote.promo_datetime_now() - future = make_offset_date(now, g.min_promote_future, - business_days=True) - if start < future.date(): - day = promote.promo_datetime_now(offset=g.min_promote_future) - day = day.strftime("%m/%d/%Y") - c.errors.add(errors.DATE_TOO_EARLY, msg_params=dict(day=day), - field="startdate") - if (form.has_errors('startdate', errors.BAD_DATE, errors.DATE_TOO_EARLY, errors.DATE_TOO_LATE) or form.has_errors('enddate', errors.BAD_DATE, errors.DATE_TOO_EARLY,