Showing
2 changed files
with
4 additions
and
6 deletions
@@ -4,7 +4,6 @@ from usuario.serializers import UsuarioListaSerializer | @@ -4,7 +4,6 @@ from usuario.serializers import UsuarioListaSerializer | ||
4 | from .constants import EXTENSIONES_VALIDAS | 4 | from .constants import EXTENSIONES_VALIDAS |
5 | from .models import Edicto, Precio | 5 | from .models import Edicto, Precio |
6 | from .utils import contador | 6 | from .utils import contador |
7 | -from .precio import contador | ||
8 | 7 | ||
9 | 8 | ||
10 | class EdictoSerializer(serializers.ModelSerializer): | 9 | class EdictoSerializer(serializers.ModelSerializer): |
@@ -42,7 +41,6 @@ class EdictoSerializer(serializers.ModelSerializer): | @@ -42,7 +41,6 @@ class EdictoSerializer(serializers.ModelSerializer): | ||
42 | data['creado_por'] = request.user | 41 | data['creado_por'] = request.user |
43 | 42 | ||
44 | data['modificado_por'] = request.user | 43 | data['modificado_por'] = request.user |
45 | - | ||
46 | return data | 44 | return data |
47 | 45 | ||
48 | @staticmethod | 46 | @staticmethod |
@@ -9,20 +9,20 @@ class CustomTokenView(TokenView): | @@ -9,20 +9,20 @@ class CustomTokenView(TokenView): | ||
9 | # realizar validaciones de recaptcha | 9 | # realizar validaciones de recaptcha |
10 | if 'captcha_value' not in request.POST: | 10 | if 'captcha_value' not in request.POST: |
11 | raise AttributeError( | 11 | raise AttributeError( |
12 | - "El campo Valor de Captcha es obligatorio" | 12 | + "El campo Valor de Captcha es obligatorio" |
13 | ) | 13 | ) |
14 | 14 | ||
15 | r = requests.post( | 15 | r = requests.post( |
16 | 'https://www.google.com/recaptcha/api/siteverify', | 16 | 'https://www.google.com/recaptcha/api/siteverify', |
17 | data={ | 17 | data={ |
18 | - 'secret': settings.SECRET_KEY_CAPTCHA, | ||
19 | - 'response': request.POST['captcha_value'], | 18 | + 'secret': settings.SECRET_KEY_CAPTCHA, |
19 | + 'response': request.POST['captcha_value'], | ||
20 | } | 20 | } |
21 | ) | 21 | ) |
22 | respuesta = r.json() | 22 | respuesta = r.json() |
23 | if not respuesta["success"]: | 23 | if not respuesta["success"]: |
24 | raise AttributeError( | 24 | raise AttributeError( |
25 | - "Captcha inválido: " + respuesta['error-codes'][0] | 25 | + "Captcha inválido: " + respuesta['error-codes'][0] |
26 | ) | 26 | ) |
27 | 27 | ||
28 | return super().post(request, *args, **kwargs) | 28 | return super().post(request, *args, **kwargs) |
-
Please register or login to post a comment