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 11:41:13 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e89e858a5314ac22915c54107157fea428086661
e89e858a
1 parent
4fd465cb
correcion en el serializer comprobante
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
project/apps/edicto/serializer.py
project/apps/edicto/serializer.py
View file @
e89e858
...
...
@@ -82,13 +82,6 @@ class PagoSerializer(serializers.ModelSerializer):
return
data
@staticmethod
def
validate_archivo
(
value
):
filename
,
extension
=
value
.
name
.
rsplit
(
"."
,
1
)
if
extension
.
lower
()
not
in
EXTENSIONES_VALIDAS
:
raise
serializers
.
ValidationError
(
"Archivos permitidos: .pdf"
)
return
value
class
ComprobanteSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -97,10 +90,17 @@ class ComprobanteSerializer(serializers.ModelSerializer):
fields
=
(
'monto'
,
'numero_comprobante'
,
'fecha_pago'
,
'archivo'
,
'archivo
_comprobante
'
,
'edicto'
,
)
read_only_fields
=
(
'monto'
,
'edicto'
,)
included_serializer
=
{
'edicto'
:
EdictoSerializer
,
}
@staticmethod
def
validate_archivo
(
value
):
filename
,
extension
=
value
.
name
.
rsplit
(
"."
,
1
)
if
extension
.
lower
()
not
in
EXTENSIONES_VALIDAS
:
raise
serializers
.
ValidationError
(
"Archivos permitidos: .pdf"
)
return
value
...
...
Please
register
or
login
to post a comment