~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to pybb/views.py

  • Committer: franku
  • Date: 2017-11-23 20:34:23 UTC
  • mto: This revision was merged to the branch mainline in revision 477.
  • Revision ID: somal@arcor.de-20171123203423-dxb9flxrman8mwox
added spam check for editing pybb posts

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
 
232
232
    if form.is_valid():
233
233
        post = form.save()
 
234
        is_spam = check_for_spam(instance=post, user=post.user, text_to_check=post.body)
 
235
        if is_spam:
 
236
            post.hidden = is_spam
 
237
            post.save()
 
238
            return HttpResponseRedirect('/moderated/')
234
239
        return HttpResponseRedirect(post.get_absolute_url())
235
240
 
236
241
    return {'form': form,