Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #3545 from eviljeff/stop-abuse-emails
Browse files Browse the repository at this point in the history
Removes the email functionality when an abuse report is submitted.
  • Loading branch information
eviljeff committed May 9, 2017
2 parents 77ef1f9 + f1f0725 commit 14b1a44
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 88 deletions.
31 changes: 0 additions & 31 deletions mkt/abuse/models.py
@@ -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
Expand Down Expand Up @@ -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
50 changes: 0 additions & 50 deletions mkt/abuse/tests/test_models.py

This file was deleted.

4 changes: 0 additions & 4 deletions mkt/abuse/tests/test_views.py
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mkt/abuse/views.py
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions mkt/settings.py
Expand Up @@ -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'
Expand Down

0 comments on commit 14b1a44

Please sign in to comment.