Add clean_tags method
@@ -182,6 +182,16 @@ class ProjectExtraForm(ProjectForm):
widget=forms.Textarea,
)
+ def clean_tags(self):
+ tags = self.cleaned_data.get('tags')
+ if tags:
+ for tag in tags:
+ if len(tag) > 100:
+ raise forms.ValidationError(
+ _('Length of each tag must be less than or equal to 100 characters.')
+ )
+ return tags
+
class ProjectAdvancedForm(ProjectTriggerBuildMixin, ProjectForm):
