projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f9e414
)
Don't crash when browser doesn't have javascript enabled
author
Magnus Hagander
<magnus@hagander.net>
Thu, 17 Dec 2015 13:03:11 +0000
(14:03 +0100)
committer
Magnus Hagander
<magnus@hagander.net>
Thu, 17 Dec 2015 13:03:11 +0000
(14:03 +0100)
Instead, just indicate that the captcha is required.
Yes, it sucks to require javascript, but it's at least only for the
signup step...
pgweb/account/recaptcha.py
patch
|
blob
|
blame
|
history
diff --git
a/pgweb/account/recaptcha.py
b/pgweb/account/recaptcha.py
index 949d9366d9603294b1590ef98e813e7939ed89db..c62fe7fd4931c576ad707fda94e50f36b9a901e0 100644
(file)
--- a/
pgweb/account/recaptcha.py
+++ b/
pgweb/account/recaptcha.py
@@
-20,7
+20,9
@@
class ReCaptchaWidget(forms.widgets.Widget):
def value_from_datadict(self, data, files, name):
if settings.NOCAPTCHA:
return None
- return data['g-recaptcha-response']
+ if data.has_key('g-recaptcha-response'):
+ return data['g-recaptcha-response']
+ return None
class ReCaptchaField(forms.CharField):