Skip to content

Commit

Permalink
Notify authors when their add-on has been flagged for admin review (b…
Browse files Browse the repository at this point in the history
…ug 546336)
  • Loading branch information
gkoberger committed Apr 28, 2011
1 parent efdb309 commit 49d00e1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
5 changes: 5 additions & 0 deletions apps/editors/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def process_preliminary(self):
def process_super_review(self):
"""Give an addon super review."""
self.addon.update(admin_review=True)
self.notify_email('author_super_review',
u'Mozilla Add-ons: %s %s flagged for Admin Review')
self.send_super_mail()


Expand Down Expand Up @@ -509,4 +511,7 @@ def process_super_review(self):
in (amo.STATUS_PENDING, amo.STATUS_UNREVIEWED)):
self.log_action(amo.LOG.ESCALATE_VERSION)

self.notify_email('author_super_review',
u'Mozilla Add-ons: %s %s flagged for Admin Review')

self.send_super_mail()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Your add-on, {{ name }} {{ number }}, has been flagged for Admin Review by an editor.

Your add-on is still on our review queue, but it will need to be checked by one of our admin reviewers. This means that your review will probably take longer than usual.

If you have any questions or comments, please reply to this email or join #addons on irc.mozilla.org
31 changes: 22 additions & 9 deletions apps/editors/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def test_notify_email(self):
for template in ['nominated_to_nominated', 'nominated_to_preliminary',
'nominated_to_public', 'nominated_to_sandbox',
'pending_to_preliminary', 'pending_to_public',
'pending_to_sandbox', 'preliminary_to_preliminary']:
'pending_to_sandbox', 'preliminary_to_preliminary',
'author_super_review']:
mail.outbox = []
self.helper.handler.notify_email(template, 'Sample subject %s, %s')
eq_(len(mail.outbox), 1)
Expand Down Expand Up @@ -452,9 +453,12 @@ def test_nomination_to_super_review(self):

eq_(self.addon.admin_review, True)

eq_(len(mail.outbox), 1)
eq_(mail.outbox[0].subject,
eq_(len(mail.outbox), 2)
eq_(mail.outbox[1].subject,
'Super review requested: Delicious Bookmarks')
eq_(mail.outbox[0].subject,
('Mozilla Add-ons: Delicious Bookmarks 2.1.072 flagged for '
'Admin Review'))
eq_(self.check_log_count(amo.LOG.REQUEST_SUPER_REVIEW.id), 1)

def test_unreviewed_to_public(self):
Expand Down Expand Up @@ -503,9 +507,12 @@ def test_preliminary_to_super_review(self):

eq_(self.addon.admin_review, True)

eq_(len(mail.outbox), 1)
eq_(mail.outbox[0].subject,
eq_(len(mail.outbox), 2)
eq_(mail.outbox[1].subject,
'Super review requested: Delicious Bookmarks')
eq_(mail.outbox[0].subject,
('Mozilla Add-ons: Delicious Bookmarks 2.1.072 flagged for '
'Admin Review'))
eq_(self.check_log_count(amo.LOG.REQUEST_SUPER_REVIEW.id), 1)

def test_nomination_to_super_review_and_escalate(self):
Expand All @@ -517,9 +524,12 @@ def test_nomination_to_super_review_and_escalate(self):

eq_(self.addon.admin_review, True)

eq_(len(mail.outbox), 1)
eq_(mail.outbox[0].subject,
eq_(len(mail.outbox), 2)
eq_(mail.outbox[1].subject,
'Super review requested: Delicious Bookmarks')
eq_(mail.outbox[0].subject,
('Mozilla Add-ons: Delicious Bookmarks 2.1.072 flagged for '
'Admin Review'))

eq_(self.check_log_count(amo.LOG.ESCALATE_VERSION.id), 1)
eq_(self.check_log_count(amo.LOG.REQUEST_SUPER_REVIEW.id), 1)
Expand Down Expand Up @@ -594,9 +604,12 @@ def test_pending_to_super_review(self):

eq_(self.addon.admin_review, True)

eq_(len(mail.outbox), 1)
eq_(mail.outbox[0].subject,
eq_(len(mail.outbox), 2)
eq_(mail.outbox[1].subject,
'Super review requested: Delicious Bookmarks')
eq_(mail.outbox[0].subject,
('Mozilla Add-ons: Delicious Bookmarks 2.1.072 flagged for '
'Admin Review'))

def test_nominated_review_time_set(self):
for status in REVIEW_ADDON_STATUSES:
Expand Down
8 changes: 8 additions & 0 deletions apps/editors/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,14 @@ def test_info_requested(self):
eq_(len(mail.outbox), 1)
self.assertTemplateUsed(response, 'editors/emails/info.ltxt')

def test_super_review_requested(self):
response = self.client.post(self.url, {'action': 'super',
'comments': 'hello sailor'})
eq_(response.status_code, 302)
eq_(len(mail.outbox), 2)
self.assertTemplateUsed(response, 'editors/emails/author_super_review.ltxt')
self.assertTemplateUsed(response, 'editors/emails/super_review.ltxt')

def test_info_requested_canned_response(self):
response = self.client.post(self.url, {'action': 'info',
'comments': 'hello sailor',
Expand Down

0 comments on commit 49d00e1

Please sign in to comment.