Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #34 from Lacrymology/dont-change-baseclass

a little "fix", avoid changing base class by subclassing
  • Loading branch information...
commit 95de71451848bbd49127a36bf05547c64c0c1630 2 parents ad69dda + 870458e
@maccesch authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 cmsplugin_contact/cms_plugins.py
View
18 cmsplugin_contact/cms_plugins.py
@@ -71,15 +71,17 @@ class ContactForm(self.contact_form, AkismetContactForm):
pass
FormClass = ContactForm
elif instance.get_spam_protection_method_display() == 'ReCAPTCHA':
- RecaptchaContactForm.recaptcha_public_key = getattr(
- settings, "RECAPTCHA_PUBLIC_KEY",
- instance.recaptcha_public_key)
- RecaptchaContactForm.recaptcha_private_key = getattr(
- settings, "RECAPTCHA_PRIVATE_KEY",
- instance.recaptcha_private_key)
- RecaptchaContactForm.recaptcha_theme = instance.recaptcha_theme
+ #if you really want the user to be able to set the key in
+ # every form, this should be more flexible
class ContactForm(self.contact_form, RecaptchaContactForm):
- pass
+ recaptcha_public_key = getattr(
+ settings, "RECAPTCHA_PUBLIC_KEY",
+ instance.recaptcha_public_key)
+ recaptcha_private_key = getattr(
+ settings, "RECAPTCHA_PRIVATE_KEY",
+ instance.recaptcha_private_key)
+ recaptcha_theme = instance.recaptcha_theme
+
FormClass = ContactForm
else:
class ContactForm(self.contact_form, HoneyPotContactForm):
Please sign in to comment.
Something went wrong with that request. Please try again.