From 299151474e5c88eb84db0e582562e606681d8ed6 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 9 Feb 2018 17:37:07 +0300 Subject: [PATCH] Fix django.db.utils.DataError: value too long for type character varying(100) --- api/v1/serializers/content.py | 1 - apps/course/models.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/api/v1/serializers/content.py b/api/v1/serializers/content.py index 6c352aa2..cdaa5351 100644 --- a/api/v1/serializers/content.py +++ b/api/v1/serializers/content.py @@ -19,7 +19,6 @@ class ContentCreateSerializer(serializers.Serializer): data = serializers.JSONField() def to_representation(self, obj): - print(obj) if isinstance(obj, Image): return ImageSerializer(obj, context=self.context).to_representation(obj) elif isinstance(obj, Text): diff --git a/apps/course/models.py b/apps/course/models.py index 69eff32b..6e430569 100644 --- a/apps/course/models.py +++ b/apps/course/models.py @@ -77,7 +77,7 @@ class Course(models.Model): def save(self, *args, **kwargs): if not self.slug: self.slug = slugify( - self.title[:100], + self.title[:90], allow_unicode=True )