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-08 09:52:29 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8762df5ca5fceffb062c30582347009a32ee56cc
8762df5c
1 parent
e32a17d8
correcciones de errores en perfom_create
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
project/apps/edicto/api.py
project/apps/edicto/api.py
View file @
8762df5
...
...
@@ -69,12 +69,10 @@ class PagoViewSets(mixins.CreateModelMixin,
def
perform_create
(
self
,
serializer
):
try
:
edicto
=
Edicto
.
objects
.
get
(
estado
=
'aprobado'
)
precio_admi
=
Precio
.
objects
.
latest
(
'id'
)
precio
=
Precio
.
objects
.
get
(
id
=
precio_admi
.
id
)
edicto
=
Edicto
.
objects
.
get
(
estado
=
'pendiente_de_pago'
)
precio
=
Precio
.
objects
.
latest
(
'id'
)
monto
=
calculadora
(
edicto
,
precio
)
usuario_actual
=
self
.
request
.
user
if
edicto
.
usuario
!=
usuario_actual
:
if
edicto
.
usuario
!=
self
.
request
.
user
:
raise
UsuarioNoAutorizado
serializer
.
validated_data
[
'monto'
]
=
monto
serializer
.
validated_data
[
'edicto'
]
=
edicto
...
...
Please
register
or
login
to post a comment