Permalink
Browse files

Merge pull request #3545 from eviljeff/stop-abuse-emails

Removes the email functionality when an abuse report is submitted.
  • Loading branch information...
2 parents 77ef1f9 + f1f0725 commit 14b1a44658e47b9f048962fa52dbf00a3beaaf30 @eviljeff eviljeff committed on GitHub May 9, 2017
Showing with 1 addition and 88 deletions.
  1. +0 −31 mkt/abuse/models.py
  2. +0 −50 mkt/abuse/tests/test_models.py
  3. +0 −4 mkt/abuse/tests/test_views.py
  4. +1 −1 mkt/abuse/views.py
  5. +0 −2 mkt/settings.py
View
@@ -1,10 +1,8 @@
import logging
-from django.conf import settings
from django.db import models
from mkt.extensions.models import Extension
-from mkt.site.mail import send_mail
from mkt.site.models import ModelBase
from mkt.users.models import UserProfile
from mkt.webapps.models import Webapp
@@ -38,35 +36,6 @@ class Meta:
def object(self):
return self.addon or self.user or self.website or self.extension
- def send(self):
- obj = self.object
- if self.reporter:
- user_name = '%s (%s)' % (self.reporter.name, self.reporter.email)
- else:
- user_name = 'An anonymous user'
-
- if self.website:
- # For Websites, it's not just abuse, the scope is broader, it could
- # be any issue about the website listing itself, so use a different
- # wording and recipient list.
- type_ = u'Website'
- subject = u'[%s] Issue Report for %s' % (type_, obj.name)
- recipient_list = (settings.MKT_FEEDBACK_EMAIL,)
- else:
- if self.addon:
- type_ = 'App'
- elif self.user:
- type_ = 'User'
- elif self.extension:
- type_ = 'FxOS Add-on'
- subject = u'[%s] Abuse Report for %s' % (type_, obj.name)
- recipient_list = (settings.ABUSE_EMAIL,)
-
- msg = u'%s reported an issue for %s (%s%s).\n\n%s' % (
- user_name, obj.name, settings.SITE_URL, obj.get_url_path(),
- self.message)
- send_mail(subject, msg, recipient_list=recipient_list)
-
# Add index on `created`.
AbuseReport._meta.get_field('created').db_index = True
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-from django.conf import settings
-from django.core import mail
-
-from nose.tools import eq_
-
-import mkt.site.tests
-from mkt.abuse.models import AbuseReport
-from mkt.extensions.models import Extension
-from mkt.site.fixtures import fixture
-from mkt.webapps.models import Webapp
-from mkt.users.models import UserProfile
-from mkt.websites.utils import website_factory
-
-
-class TestAbuse(mkt.site.tests.TestCase):
- fixtures = fixture('user_999', 'webapp_337141')
-
- def setUp(self):
- self.app = Webapp.objects.get(pk=337141)
- self.user = UserProfile.objects.get(pk=999)
-
- def test_user(self):
- AbuseReport(user=self.user).send()
- assert mail.outbox[0].subject.startswith('[User]')
- eq_(mail.outbox[0].to, [settings.ABUSE_EMAIL])
-
- def test_addon(self):
- AbuseReport(addon=self.app).send()
- assert mail.outbox[0].subject.startswith('[App]')
- eq_(mail.outbox[0].to, [settings.ABUSE_EMAIL])
-
- def test_addon_fr(self):
- with self.activate(locale='fr'):
- AbuseReport(addon=self.app).send()
- assert mail.outbox[0].subject.startswith('[App]')
- eq_(mail.outbox[0].to, [settings.ABUSE_EMAIL])
-
- def test_website(self):
- website = website_factory()
- AbuseReport(website=website).send()
- assert mail.outbox[0].subject.startswith('[Website]')
- eq_(mail.outbox[0].to, [settings.MKT_FEEDBACK_EMAIL])
-
- def test_extension(self):
- extension = Extension.objects.create(
- name=u'Test Êxtension', slug=u'test-ëxtension')
- AbuseReport(extension=extension).send()
- assert mail.outbox[0].subject.startswith('[FxOS Add-on]')
- eq_(mail.outbox[0].to, [settings.ABUSE_EMAIL])
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import json
-from django.core import mail
from django.core.urlresolvers import reverse
from django.utils.http import urlencode
@@ -91,9 +90,6 @@ def _test_success(self, res, data):
eq_(newest_report.message, data['text'])
eq_(newest_report.ip_address, self.headers['REMOTE_ADDR'])
- eq_(len(mail.outbox), 1)
- assert self.default_data['text'] in mail.outbox[0].body
-
def test_get(self):
res = self.client.get(self.list_url)
eq_(res.status_code, 405)
View
@@ -27,7 +27,7 @@ class BaseAbuseViewSet(CORSMixin, generics.CreateAPIView,
permission_classes = (AllowAny,)
def perform_create(self, serializer):
- serializer.save().send()
+ serializer.save()
class AppAbuseViewSet(BaseAbuseViewSet):
View
@@ -306,13 +306,11 @@ def path(*args):
###########################################
# Team Emails
-ABUSE_EMAIL = 'Firefox Marketplace Staff <marketplace-staff+ivebeenappused@mozilla.org>' # noqa
APP_CURATION_BOARD_EMAIL = 'appcurationboard@mozilla.org'
APP_DELETION_EMAIL = 'marketplace-staff+deletions@mozilla.org'
SUPPORT_GROUP = 'https://groups.google.com/forum/#!forum/mozilla.appreview'
MARKETPLACE_EMAIL = 'marketplace-staff@mozilla.org'
MKT_APPS_FEEDBACK_EMAIL = 'apps-feedback@mozilla.com'
-MKT_FEEDBACK_EMAIL = 'marketplace-feedback@mozilla.org'
MKT_REVIEWERS_EMAIL = 'appreview@lists.mozilla.org'
MKT_REVIEWS_EMAIL = 'app-reviews@mozilla.org'
NOBODY_EMAIL_ADDRESS = 'nobody@mozilla.org'

0 comments on commit 14b1a44

Please sign in to comment.