Commit f7e6f0f4 authored by Hamza Dely's avatar Hamza Dely
Browse files

Correction de quelques typos

parent a0ab13a7
......@@ -7,6 +7,9 @@ import binascii
from django.core.files.base import ContentFile
from django.core.validators import EMPTY_VALUES
from rest_framework.exceptions import ValidationError
__all__ = ['Base64FieldMixin', 'DynamicFieldsMixin']
class DynamicFieldsMixin(object):
......@@ -53,7 +56,7 @@ class Base64FieldMixin(object):
raise ValidationError("Les données encodées ne sont pas sous forme d'une chaîne en base 64")
if ";base64," in b64_data:
header, b64_data = b64_data.split(';base64,')
b64_data = b64_data.split(';base64,')[-1]
data = base64.b64decode(b64_data)
......@@ -64,4 +67,4 @@ class Base64FieldMixin(object):
return super().to_internal_value(file_obj)
def get_file_type(self, obj):
raise NotImplemented
raise NotImplementedError
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment