From a76034b8d8069f5361ecc3c4fac2dd83592ed98c Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Thu, 3 Nov 2016 12:54:19 -0400 Subject: [PATCH] Disable report spam on private instance. --- snipts/templates/snipts/snipt-list.html | 11 ----------- snipts/urls.py | 3 --- snipts/views.py | 21 --------------------- 3 files changed, 35 deletions(-) diff --git a/snipts/templates/snipts/snipt-list.html b/snipts/templates/snipts/snipt-list.html index 67f5de4..388c784 100644 --- a/snipts/templates/snipts/snipt-list.html +++ b/snipts/templates/snipts/snipt-list.html @@ -209,17 +209,6 @@ / API {% endif %} - {% if request.user.is_authenticated and snipt.user != request.user %} - {% if request.user.is_superuser %} -
  • - Delete User -
  • - {% else %} -
  • - Report Spam -
  • - {% endif %} - {% endif %} {% if detail and snipt.public %}
  • diff --git a/snipts/urls.py b/snipts/urls.py index c9bdda7..8b512f5 100644 --- a/snipts/urls.py +++ b/snipts/urls.py @@ -29,9 +29,6 @@ urlpatterns = [ url(r'^raw/(?P[^/]+)/(?P[^\?]+)?$', views.raw, name='raw'), - url(r'^report-spam/(?P[^/]+)/$', - views.report_spam, - name='report-spam'), url(r'^(?P[^/]+)/$', views.list_user, name='list-user'), diff --git a/snipts/views.py b/snipts/views.py index 9327564..fb653dc 100644 --- a/snipts/views.py +++ b/snipts/views.py @@ -89,27 +89,6 @@ def embed(request, snipt_key): content_type='application/javascript') -def report_spam(request, snipt_id): - - if not request.user.is_authenticated(): - return HttpResponseBadRequest() - - snipt = get_object_or_404(Snipt, pk=snipt_id) - - send_mail('[Snipt] Spam reported', - """ - Snipt: https://snipt.net/admin/snipts/snipt/{}/ - User: https://snipt.net/admin/auth/user/{}/delete/ - Reporter: https://snipt.net/{}/ - """.format(snipt.id, snipt.user.id, request.user.username), - os.environ.get('POSTMARK_EMAIL', 'support@snipt.net'), - ['nick@snipt.net'], - fail_silently=False) - - return HttpResponse("""Thanks! Your report has been - submitted to the site admins.""") - - @render_to('snipts/list-user.html') def blog_posts(request, username):