Some robots doesn't set referer when they try to add comment

This commit is contained in:
Gregory Soutade 2016-06-05 09:13:46 +02:00
parent 7fff2dbd2d
commit 7b93925d00

View File

@ -802,7 +802,10 @@ def tinymcelist_edit(request, post_id):
def add_comment(request, post_id, parent_id):
from dynastie.generators import post
ref = request.META['HTTP_REFERER']
if not 'HTTP_REFERER' in request.META:
ref = "/"
else:
ref = request.META['HTTP_REFERER']
# Anti robot !!
if request.POST['email'] != '':