Do not force house priority for mobile targeting

This commit is contained in:
zeantsoi
2015-07-05 14:41:54 -07:00
parent 8f9f171c38
commit 19c8074e87
4 changed files with 2 additions and 10 deletions

View File

@@ -1008,11 +1008,6 @@ class PromoteApiController(ApiController):
form.set_error(errors.BAD_PROMO_MOBILE_OS, 'mobile_os')
return
if platform == 'mobile' and priority.cpm:
c.errors.add(errors.BAD_PROMO_MOBILE_PRIORITY, field='priority')
form.set_error(errors.BAD_PROMO_MOBILE_PRIORITY, 'priority')
return
if not (c.user_is_sponsor or platform == 'desktop'):
return abort(403, 'forbidden')

View File

@@ -164,7 +164,6 @@ error_list = dict((
('GOLD_ONLY_SR_REQUIRED', _("this subreddit must be 'gold only' to select this")),
('CANT_CREATE_SR', _("your account is too new to create a subreddit. please contact the admins to request an exemption.")),
('BAD_PROMO_MOBILE_OS', _("you must select at least one mobile OS to target")),
('BAD_PROMO_MOBILE_PRIORITY', _("mobile campaigns may only use house priority")),
))
errors = Storage([(e, e) for e in error_list.keys()])

View File

@@ -1064,11 +1064,10 @@ var exports = r.sponsored = {
var platformOverride = platformTargeting.isMobile && platformTargeting.platform === 'mobile';
var $priorities = $form.find('*[name="priority"]');
if (platformOverride) {
if (platformOverride && this.currentPlatform != 'mobile') {
$priorities.filter('[value="house"]').prop('checked', 'checked');
$priorities.filter(':not([value="house"])').prop('disabled', true);
} else {
if (this.currentPlatform === 'mobile') {
if (!platformOverride && this.currentPlatform === 'mobile') {
$priorities.filter('[value="standard"]').prop('checked', 'checked');
}
$priorities.prop('disabled', false);

View File

@@ -445,7 +445,6 @@
%endif
</label>
%endfor
${error_field("BAD_PROMO_MOBILE_PRIORITY", "priority", "div")}
</div>
</%def>