cc theme review email on theme reviews (bug 856154)
This commit is contained in:
Родитель
d92509250c
Коммит
fdca0979a7
|
@ -30,6 +30,7 @@ def send_mail(cleaned_data, theme_lock):
|
|||
comment = cleaned_data['comment']
|
||||
|
||||
emails = set(theme.addon.authors.values_list('email', flat=True))
|
||||
cc = settings.THEMES_EMAIL
|
||||
context = {
|
||||
'theme': theme,
|
||||
'base_url': settings.SITE_URL,
|
||||
|
@ -56,7 +57,6 @@ def send_mail(cleaned_data, theme_lock):
|
|||
elif action == rvw.ACTION_FLAG:
|
||||
subject = _('Theme submission flagged for review')
|
||||
template = 'reviewers/themes/emails/flag_reviewer.html'
|
||||
emails = [settings.THEMES_EMAIL]
|
||||
theme.addon.update(status=amo.STATUS_REVIEW_PENDING)
|
||||
|
||||
# Send another email to the user notifying them that their Theme has
|
||||
|
@ -66,6 +66,10 @@ def send_mail(cleaned_data, theme_lock):
|
|||
recipient_list=emails,
|
||||
headers={'Reply-To': settings.THEMES_EMAIL})
|
||||
|
||||
# Send the other email below to themes email.
|
||||
emails = [settings.THEMES_EMAIL]
|
||||
cc = None
|
||||
|
||||
elif action == rvw.ACTION_MOREINFO:
|
||||
subject = _('A question about your Theme submission')
|
||||
template = 'reviewers/themes/emails/moreinfo.html'
|
||||
|
@ -82,5 +86,5 @@ def send_mail(cleaned_data, theme_lock):
|
|||
theme.save()
|
||||
|
||||
send_mail_jinja(subject, template, context,
|
||||
recipient_list=emails,
|
||||
recipient_list=emails, cc=cc,
|
||||
headers={'Reply-To': settings.THEMES_EMAIL})
|
||||
|
|
|
@ -2117,7 +2117,7 @@ class ThemeReviewTestMixin(object):
|
|||
'reviewer_email': u'reviewer0@mozilla.com',
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=set([])),
|
||||
recipient_list=set([]), cc=settings.THEMES_EMAIL),
|
||||
mock.call('A problem with your Theme submission',
|
||||
'reviewers/themes/emails/flag_user.html',
|
||||
{'reason': None,
|
||||
|
@ -2125,7 +2125,7 @@ class ThemeReviewTestMixin(object):
|
|||
'theme': themes[1],
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=[settings.THEMES_EMAIL]),
|
||||
recipient_list=set([])),
|
||||
mock.call('Theme submission flagged for review',
|
||||
'reviewers/themes/emails/flag_reviewer.html',
|
||||
{'reason': None,
|
||||
|
@ -2133,7 +2133,7 @@ class ThemeReviewTestMixin(object):
|
|||
'theme': themes[1],
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=[settings.THEMES_EMAIL]),
|
||||
recipient_list=[settings.THEMES_EMAIL], cc=None),
|
||||
mock.call('A problem with your Theme submission',
|
||||
'reviewers/themes/emails/reject.html',
|
||||
{'reason': mock.ANY,
|
||||
|
@ -2141,7 +2141,7 @@ class ThemeReviewTestMixin(object):
|
|||
'theme': themes[2],
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=set([])),
|
||||
recipient_list=set([]), cc=settings.THEMES_EMAIL),
|
||||
mock.call('A problem with your Theme submission',
|
||||
'reviewers/themes/emails/reject.html',
|
||||
{'reason': mock.ANY,
|
||||
|
@ -2149,7 +2149,7 @@ class ThemeReviewTestMixin(object):
|
|||
'theme': themes[3],
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=set([])),
|
||||
recipient_list=set([]), cc=settings.THEMES_EMAIL),
|
||||
mock.call('Thanks for submitting your Theme',
|
||||
'reviewers/themes/emails/approve.html',
|
||||
{'reason': None,
|
||||
|
@ -2157,7 +2157,7 @@ class ThemeReviewTestMixin(object):
|
|||
'theme': themes[4],
|
||||
'base_url': 'http://testserver'},
|
||||
headers={'Reply-To': settings.THEMES_EMAIL},
|
||||
recipient_list=set([]))
|
||||
recipient_list=set([]), cc=settings.THEMES_EMAIL)
|
||||
]
|
||||
eq_(send_mail_jinja_mock.call_args_list[0], expected_calls[0])
|
||||
eq_(send_mail_jinja_mock.call_args_list[1], expected_calls[1])
|
||||
|
|
Загрузка…
Ссылка в новой задаче