-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
try: | ||
from snowpenguin.django.recaptcha2.fields import ReCaptchaField | ||
from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget | ||
except ImportError: | ||
ReCaptchaField = None | ||
ReCaptchaWidget = None | ||
try: | ||
from hcaptcha_field import hCaptchaField | ||
except ImportError: | ||
hCaptchaField = None | ||
|
||
from django.conf import settings | ||
|
||
if not hasattr(settings, 'RECAPTCHA_PRIVATE_KEY') and ReCaptchaField is not None: | ||
ReCaptchaField = None | ||
ReCaptchaWidget = None | ||
elif not hasattr(settings, 'HCAPTCHA_SECRET') and hCaptchaField is not None: | ||
hCaptchaField = None | ||
|
||
CaptchaField = ReCaptchaField or hCaptchaField |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters