From f1147f695a2a76a9220e1add002b2f8775d48a38 Mon Sep 17 00:00:00 2001 From: Vladyslav T Date: Sat, 25 Oct 2014 22:53:56 +0300 Subject: [PATCH] Fix replace function for custom fields --- helpdesk/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk/forms.py b/helpdesk/forms.py index da46bc31..ba22c232 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -102,7 +102,7 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm): for field, value in self.cleaned_data.items(): if field.startswith('custom_'): - field_name = field.replace('custom_', '') + field_name = field.replace('custom_', '', 1) customfield = CustomField.objects.get(name=field_name) try: cfv = TicketCustomFieldValue.objects.get(ticket=self.instance, field=customfield) @@ -229,7 +229,7 @@ class TicketForm(CustomFieldMixin, forms.Form): for field, value in self.cleaned_data.items(): if field.startswith('custom_'): - field_name = field.replace('custom_', '') + field_name = field.replace('custom_', '', 1) customfield = CustomField.objects.get(name=field_name) cfv = TicketCustomFieldValue(ticket=t, field=customfield, @@ -407,7 +407,7 @@ class PublicTicketForm(CustomFieldMixin, forms.Form): for field, value in self.cleaned_data.items(): if field.startswith('custom_'): - field_name = field.replace('custom_', '') + field_name = field.replace('custom_', '', 1) customfield = CustomField.objects.get(name=field_name) cfv = TicketCustomFieldValue(ticket=t, field=customfield,