Merge pull request #1270 from kennedydane/main

Make title length in form consistent with title length in model.
This commit is contained in:
Christopher Broderick 2025-06-02 14:21:32 +01:00 committed by GitHub
commit 653a9f983d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 5 deletions

View File

@ -129,8 +129,10 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm):
# 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
self.fields["title"].max_length = Ticket._meta.get_field("title").max_length
self.fields["title"].widget.attrs["maxlength"] = Ticket._meta.get_field(
"title"
).max_length
# Disable and add help_text to the merged_to field on this form
self.fields["merged_to"].disabled = True
@ -272,7 +274,7 @@ class AbstractTicketForm(CustomFieldMixin, forms.Form):
)
title = forms.CharField(
max_length=100,
max_length=200,
required=True,
widget=forms.TextInput(attrs={"class": "form-control"}),
label=_("Summary of the problem"),

View File

@ -0,0 +1,17 @@
# Generated by Django 5.2.1 on 2025-06-02 09:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("helpdesk", "0038_checklist_checklisttemplate_checklisttask"),
]
operations = [
migrations.AlterField(
model_name="ticketchange",
name="field",
field=models.CharField(max_length=200, verbose_name="Field"),
),
]

View File

@ -1161,7 +1161,7 @@ class TicketChange(models.Model):
field = models.CharField(
_("Field"),
max_length=100,
max_length=200,
)
old_value = models.TextField(

View File

@ -7,7 +7,7 @@ from setuptools import find_packages, setup
import sys
version = "1.5.0"
version = "1.5.1"
# Provided as an attribute, so you can append to these instead