Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Marta Miranda
/
boletin_api
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Enzo Yair
2023-09-29 07:08:30 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0d938de94b727cec28af61b61edc3bfc61429210
0d938de9
1 parent
828c431c
eliminando cambios ajenos al feature
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
project/apps/edicto/serializer.py
project/apps/usuario/views.py
project/apps/edicto/serializer.py
View file @
0d938de
...
...
@@ -4,7 +4,6 @@ from usuario.serializers import UsuarioListaSerializer
from
.constants
import
EXTENSIONES_VALIDAS
from
.models
import
Edicto
,
Precio
from
.utils
import
contador
from
.precio
import
contador
class
EdictoSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -42,7 +41,6 @@ class EdictoSerializer(serializers.ModelSerializer):
data
[
'creado_por'
]
=
request
.
user
data
[
'modificado_por'
]
=
request
.
user
return
data
@staticmethod
...
...
project/apps/usuario/views.py
View file @
0d938de
...
...
@@ -9,20 +9,20 @@ class CustomTokenView(TokenView):
# realizar validaciones de recaptcha
if
'captcha_value'
not
in
request
.
POST
:
raise
AttributeError
(
"El campo Valor de Captcha es obligatorio"
"El campo Valor de Captcha es obligatorio"
)
r
=
requests
.
post
(
'https://www.google.com/recaptcha/api/siteverify'
,
data
=
{
'secret'
:
settings
.
SECRET_KEY_CAPTCHA
,
'response'
:
request
.
POST
[
'captcha_value'
],
'secret'
:
settings
.
SECRET_KEY_CAPTCHA
,
'response'
:
request
.
POST
[
'captcha_value'
],
}
)
respuesta
=
r
.
json
()
if
not
respuesta
[
"success"
]:
raise
AttributeError
(
"Captcha inválido: "
+
respuesta
[
'error-codes'
][
0
]
"Captcha inválido: "
+
respuesta
[
'error-codes'
][
0
]
)
return
super
()
.
post
(
request
,
*
args
,
**
kwargs
)
...
...
Please
register
or
login
to post a comment