mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 16:03:19 +01:00
Merge pull request #273 from vladyslav2/master
Fix replace function for custom fields
This commit is contained in:
commit
0d9446480e
@ -102,7 +102,7 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm):
|
|||||||
|
|
||||||
for field, value in self.cleaned_data.items():
|
for field, value in self.cleaned_data.items():
|
||||||
if field.startswith('custom_'):
|
if field.startswith('custom_'):
|
||||||
field_name = field.replace('custom_', '')
|
field_name = field.replace('custom_', '', 1)
|
||||||
customfield = CustomField.objects.get(name=field_name)
|
customfield = CustomField.objects.get(name=field_name)
|
||||||
try:
|
try:
|
||||||
cfv = TicketCustomFieldValue.objects.get(ticket=self.instance, field=customfield)
|
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():
|
for field, value in self.cleaned_data.items():
|
||||||
if field.startswith('custom_'):
|
if field.startswith('custom_'):
|
||||||
field_name = field.replace('custom_', '')
|
field_name = field.replace('custom_', '', 1)
|
||||||
customfield = CustomField.objects.get(name=field_name)
|
customfield = CustomField.objects.get(name=field_name)
|
||||||
cfv = TicketCustomFieldValue(ticket=t,
|
cfv = TicketCustomFieldValue(ticket=t,
|
||||||
field=customfield,
|
field=customfield,
|
||||||
@ -407,7 +407,7 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
|
|||||||
|
|
||||||
for field, value in self.cleaned_data.items():
|
for field, value in self.cleaned_data.items():
|
||||||
if field.startswith('custom_'):
|
if field.startswith('custom_'):
|
||||||
field_name = field.replace('custom_', '')
|
field_name = field.replace('custom_', '', 1)
|
||||||
customfield = CustomField.objects.get(name=field_name)
|
customfield = CustomField.objects.get(name=field_name)
|
||||||
cfv = TicketCustomFieldValue(ticket=t,
|
cfv = TicketCustomFieldValue(ticket=t,
|
||||||
field=customfield,
|
field=customfield,
|
||||||
|
Loading…
Reference in New Issue
Block a user