Showing
1 changed file
with
8 additions
and
8 deletions
@@ -82,13 +82,6 @@ class PagoSerializer(serializers.ModelSerializer): | @@ -82,13 +82,6 @@ class PagoSerializer(serializers.ModelSerializer): | ||
82 | 82 | ||
83 | return data | 83 | return data |
84 | 84 | ||
85 | - @staticmethod | ||
86 | - def validate_archivo(value): | ||
87 | - filename, extension = value.name.rsplit(".", 1) | ||
88 | - if extension.lower() not in EXTENSIONES_VALIDAS: | ||
89 | - raise serializers.ValidationError("Archivos permitidos: .pdf") | ||
90 | - return value | ||
91 | - | ||
92 | 85 | ||
93 | class ComprobanteSerializer(serializers.ModelSerializer): | 86 | class ComprobanteSerializer(serializers.ModelSerializer): |
94 | 87 | ||
@@ -97,10 +90,17 @@ class ComprobanteSerializer(serializers.ModelSerializer): | @@ -97,10 +90,17 @@ class ComprobanteSerializer(serializers.ModelSerializer): | ||
97 | fields = ('monto', | 90 | fields = ('monto', |
98 | 'numero_comprobante', | 91 | 'numero_comprobante', |
99 | 'fecha_pago', | 92 | 'fecha_pago', |
100 | - 'archivo', | 93 | + 'archivo_comprobante', |
101 | 'edicto', | 94 | 'edicto', |
102 | ) | 95 | ) |
103 | read_only_fields = ('monto', 'edicto',) | 96 | read_only_fields = ('monto', 'edicto',) |
104 | 97 | ||
105 | included_serializer = {'edicto': EdictoSerializer, | 98 | included_serializer = {'edicto': EdictoSerializer, |
106 | } | 99 | } |
100 | + | ||
101 | + @staticmethod | ||
102 | + def validate_archivo(value): | ||
103 | + filename, extension = value.name.rsplit(".", 1) | ||
104 | + if extension.lower() not in EXTENSIONES_VALIDAS: | ||
105 | + raise serializers.ValidationError("Archivos permitidos: .pdf") | ||
106 | + return value |
-
Please register or login to post a comment