Browse files

add in all apps email choice (bug 797079)

  • Loading branch information...
1 parent 286d9e0 commit 43b35c7dc398f99e72a742b473ddef37f7370230 @andymckay andymckay committed Oct 2, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 apps/zadmin/forms.py
  2. +6 −0 apps/zadmin/tests/test_views.py
  3. +2 −0 apps/zadmin/views.py
View
1 apps/zadmin/forms.py
@@ -33,6 +33,7 @@ class DevMailerForm(happyforms.Form):
_choices = [('eula',
'Developers who have set up EULAs for active add-ons'),
('sdk', 'Developers of active SDK add-ons'),
+ ('apps', 'Developers of active apps (not add-ons)'),
('payments',
'Developers of active apps (not add-ons) with payments')]
recipients = forms.ChoiceField(choices=_choices, required=True)
View
6 apps/zadmin/tests/test_views.py
@@ -1931,6 +1931,12 @@ def test_only_apps_with_payments(self):
self.assertNoFormErrors(res)
eq_(len(mail.outbox), 1)
+ def test_only_apps(self):
+ self.addon.update(type=amo.ADDON_WEBAPP)
+ res = self.post(recipients='apps')
+ self.assertNoFormErrors(res)
+ eq_(len(mail.outbox), 1)
+
def test_ignore_deleted(self):
self.addon.update(status=amo.STATUS_DELETED)
res = self.post()
View
2 apps/zadmin/views.py
@@ -631,6 +631,8 @@ def email_devs(request):
qs = qs.exclude(addon__paypal_id=None)
qs = qs.exclude(addon__premium_type__in=(amo.ADDON_FREE,
amo.ADDON_OTHER_INAPP))
+ elif data['recipients'] == 'apps':
+ qs = qs.filter(addon__type=amo.ADDON_WEBAPP)
elif data['recipients'] == 'sdk':
qs = qs.exclude(addon__versions__files__jetpack_version=None)
else:

0 comments on commit 43b35c7

Please sign in to comment.