Skip to content

Commit a7b3656

Browse files
committed
add default value
1 parent aa00c77 commit a7b3656

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

readthedocs/projects/forms.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ class Meta(object):
183183
)
184184

185185
def clean_tags(self):
186-
tags = self.cleaned_data.get('tags')
187-
if tags:
188-
for tag in tags:
189-
if len(tag) > 100:
190-
raise forms.ValidationError(
191-
_('Length of each tag must be less than or equal to 100 characters.')
192-
)
186+
tags = self.cleaned_data.get('tags', [])
187+
for tag in tags:
188+
if len(tag) > 100:
189+
raise forms.ValidationError(
190+
_('Length of each tag must be less than or equal to 100 characters.')
191+
)
193192
return tags
194193

195194

0 commit comments

Comments
 (0)