From 1cb00ebc0b9d1447bcfed268b25c214442dae482 Mon Sep 17 00:00:00 2001 From: Tris Forster Date: Thu, 23 Feb 2023 20:29:04 +1100 Subject: [PATCH] Fixing bulk importer --- app/library/views/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/library/views/api.py b/app/library/views/api.py index 3a1fd2a..b549fa7 100644 --- a/app/library/views/api.py +++ b/app/library/views/api.py @@ -67,7 +67,7 @@ class SectionSerializer(serializers.ModelSerializer): def to_representation(self, instance): start = instance.start or 0 end = instance.end or 0 - return f"{instance.tag}:{instance.type}:{start}:{end}" + return f"{instance.tag}:{start}:{end}" def to_internal_value(self, data): tag, section_type, start, end = data.split(":") @@ -79,7 +79,7 @@ class SectionSerializer(serializers.ModelSerializer): end = int(end) except: end = 0 - return super().to_internal_value({'tag': tag, 'type': int(section_type), 'start': start, 'end': end}) + return super().to_internal_value({'tag': tag, 'start': start, 'end': end}) class DocumentSerializer(serializers.ModelSerializer):