Showing
3 changed files
with
8 additions
and
6 deletions
1 | -# Generated by Django 4.1.9 on 2023-09-28 13:17 | 1 | +# Generated by Django 4.1.9 on 2023-09-29 10:02 |
2 | 2 | ||
3 | from django.db import migrations, models | 3 | from django.db import migrations, models |
4 | 4 | ||
@@ -30,7 +30,7 @@ class Migration(migrations.Migration): | @@ -30,7 +30,7 @@ class Migration(migrations.Migration): | ||
30 | migrations.AddField( | 30 | migrations.AddField( |
31 | model_name='edicto', | 31 | model_name='edicto', |
32 | name='tiene_descuento', | 32 | name='tiene_descuento', |
33 | - field=models.BooleanField(default=False, editable=False), | 33 | + field=models.BooleanField(editable=False), |
34 | preserve_default=False, | 34 | preserve_default=False, |
35 | ), | 35 | ), |
36 | migrations.AddField( | 36 | migrations.AddField( |
@@ -4,6 +4,7 @@ from usuario.serializers import UsuarioListaSerializer | @@ -4,6 +4,7 @@ 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 | ||
7 | 8 | ||
8 | 9 | ||
9 | class EdictoSerializer(serializers.ModelSerializer): | 10 | class EdictoSerializer(serializers.ModelSerializer): |
@@ -41,6 +42,7 @@ class EdictoSerializer(serializers.ModelSerializer): | @@ -41,6 +42,7 @@ class EdictoSerializer(serializers.ModelSerializer): | ||
41 | data['creado_por'] = request.user | 42 | data['creado_por'] = request.user |
42 | 43 | ||
43 | data['modificado_por'] = request.user | 44 | data['modificado_por'] = request.user |
45 | + | ||
44 | return data | 46 | return data |
45 | 47 | ||
46 | @staticmethod | 48 | @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