Merge pull request #1262 from DavidVadnais/BUG-1261-edit-ticket-allows-long-titles

BUG: Limit title length in edit ticket form
This commit is contained in:
Christopher Broderick 2025-05-08 18:48:53 +02:00 committed by GitHub
commit 7dc6a1c133
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,6 +127,11 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm):
""" """
super(EditTicketForm, self).__init__(*args, **kwargs) super(EditTicketForm, self).__init__(*args, **kwargs)
# Since title is max 100 characters limit it in editing
if "title" in self.fields:
self.fields["title"].max_length = 100
self.fields["title"].widget.attrs["maxlength"] = 100
# Disable and add help_text to the merged_to field on this form # Disable and add help_text to the merged_to field on this form
self.fields["merged_to"].disabled = True self.fields["merged_to"].disabled = True
self.fields["merged_to"].help_text = _( self.fields["merged_to"].help_text = _(