1

I have made custom comment app. The only difference that it has reCAPTCHA field in comment form.

class CustomCommentForm(CommentForm):
    recaptcha = ReCAPTCHAField()

I used this snippet http://djangosnippets.org/snippets/1653/ for integration django comments and reCAPTCHA.

I want authorized users to post comment without filling recaptcha field and unauthorized users have to fill it. I thought about creating 2 different form (one with recaptcha for anonymous users and other without it for authorized). But how can I provide different forms when django documentation says that I have to override get_form() method and with it function I can return only one form? Or should I wrap post_comment view of django-comments-framework?

Nick
  • 1,134
  • 7
  • 12

1 Answers1

0

Maybe this can help you, presumably you could move the logic for checking user into get_form.

http://djangosnippets.org/snippets/1662/

slackjake
  • 197
  • 1
  • 5
  • When I said about get_form() I meant function in __init__.py of my custom comments framework. See __init__.py example in Django documentation (https://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/). get_form has got no input arguments, so I can't do any logic there. – Nick Aug 16 '12 at 08:53