mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-28 19:03:14 +01:00
Rename ticket_attriubtes
to upper, module level constant.
This commit is contained in:
parent
a783156b61
commit
eb11c4fe0e
@ -989,7 +989,7 @@ mass_update = staff_member_required(mass_update)
|
|||||||
|
|
||||||
# Prepare ticket attributes which will be displayed in the table to choose
|
# Prepare ticket attributes which will be displayed in the table to choose
|
||||||
# which value to keep when merging
|
# which value to keep when merging
|
||||||
ticket_attributes = (
|
TICKET_ATTRIBUTES = (
|
||||||
('created', _('Created date')),
|
('created', _('Created date')),
|
||||||
('due_date', _('Due on')),
|
('due_date', _('Due on')),
|
||||||
('get_status_display', _('Status')),
|
('get_status_display', _('Status')),
|
||||||
@ -1008,7 +1008,7 @@ def merge_ticket_values(
|
|||||||
for ticket in tickets:
|
for ticket in tickets:
|
||||||
ticket.values = {}
|
ticket.values = {}
|
||||||
# Prepare the value for each attributes of this ticket
|
# Prepare the value for each attributes of this ticket
|
||||||
for attribute, __ in ticket_attributes:
|
for attribute, __ in TICKET_ATTRIBUTES:
|
||||||
value = getattr(ticket, attribute, TicketCustomFieldValue.default_value)
|
value = getattr(ticket, attribute, TicketCustomFieldValue.default_value)
|
||||||
# Check if attr is a get_FIELD_display
|
# Check if attr is a get_FIELD_display
|
||||||
if attribute.startswith('get_') and attribute.endswith('_display'):
|
if attribute.startswith('get_') and attribute.endswith('_display'):
|
||||||
@ -1061,7 +1061,7 @@ def merge_tickets(request):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# Save ticket fields values
|
# Save ticket fields values
|
||||||
for attribute, __ in ticket_attributes:
|
for attribute, __ in TICKET_ATTRIBUTES:
|
||||||
id_for_attribute = request.POST.get(attribute)
|
id_for_attribute = request.POST.get(attribute)
|
||||||
if id_for_attribute != chosen_ticket.id:
|
if id_for_attribute != chosen_ticket.id:
|
||||||
try:
|
try:
|
||||||
@ -1151,7 +1151,7 @@ def merge_tickets(request):
|
|||||||
|
|
||||||
return render(request, 'helpdesk/ticket_merge.html', {
|
return render(request, 'helpdesk/ticket_merge.html', {
|
||||||
'tickets': tickets,
|
'tickets': tickets,
|
||||||
'ticket_attributes': ticket_attributes,
|
'TICKET_ATTRIBUTES': TICKET_ATTRIBUTES,
|
||||||
'custom_fields': custom_fields,
|
'custom_fields': custom_fields,
|
||||||
'ticket_select_form': ticket_select_form
|
'ticket_select_form': ticket_select_form
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user