From 19d66c3fef8e3f75d3b0958fcf9b513aa1674344 Mon Sep 17 00:00:00 2001 From: doubaniux Date: Fri, 10 Jul 2020 22:49:08 +0800 Subject: [PATCH] fix empty tag bug --- common/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/forms.py b/common/forms.py index b8c585ae..890bb37c 100644 --- a/common/forms.py +++ b/common/forms.py @@ -107,4 +107,6 @@ class TagField(forms.CharField): widget = TagInput def to_python(self, value): value = super().to_python(value) + if not value: + return return [t.strip() for t in value.split(',')]