- data = {
- "user_ip":request.META["REMOTE_ADDR"],
- "user_agent":request.environ['HTTP_USER_AGENT'],
- "comment_author":request.user.username,
- "comment_author_email":request.user.email,
- "comment_author_url":request.user.website,
- "comment":request.POST['text']
- }
- if Node.isSpam(request.POST['text'], data):
- raise SpamNotAllowedException("answer")
-
- answer = AnswerAction(user=request.user).save(dict(question=question, **form.cleaned_data)).node
+ answer = AnswerAction(user=request.user, ip=request.META['REMOTE_ADDR']).save(dict(question=question, **form.cleaned_data)).node