Showing
1 changed file
with
7 additions
and
0 deletions
@@ -82,6 +82,13 @@ class PagoSerializer(serializers.ModelSerializer): | @@ -82,6 +82,13 @@ 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 | + | ||
85 | 92 | ||
86 | class ComprobanteSerializer(serializers.ModelSerializer): | 93 | class ComprobanteSerializer(serializers.ModelSerializer): |
87 | 94 |
-
Please register or login to post a comment