Fixed bugs, put key to html form

This commit is contained in:
HooVee
2016-09-27 21:59:30 +03:00
parent 4c6e951cf4
commit 95bc30e1eb
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ app.controller("applicationController", function($scope, $http, $location, $wind
var valid;
//server side validation
$scope.member.reCaptchaResponse = vcRecaptchaService.getResponse()
if(resp === "") {
alert("Ole hyvä ja täytä kuvavarmennus");
if($scope.member.reCaptchaResponse === "") {
notyError("Ole hyvä ja täytä kuvavarmennus");
} else {
$http.post("/members/api/request", $scope.member).then(function(data){
notySuccess("Hakemus lähetetty!");
+1 -1
View File
@@ -64,7 +64,7 @@
<div
vc-recaptcha
theme="'light'"
key="model.key"
key="6LevHAcUAAAAAA45B7c-7qja-2aSwHztr9xb4K2Z"
on-create="setWidgetId(widgetId)"
on-success="setResponse(response)"
on-expire="cbExpiration()"
+4 -2
View File
@@ -17,9 +17,11 @@ def validateReCaptcha(response):
'response': response,
}
url = "https://www.google.com/recaptcha/api/siteverify"
headers = {'Content-type': 'application/json'}
headers = {'Content-type': 'application/json'}
resp = requests.post(url, data=json.dumps(values), headers=headers)
result = json.loads(resp.read())
result = json.loads(resp.text)
print(resp.text)
print(values)
if not result["success"]:
return False
return True