Fixes #122 - avoid exception when taking ticket.

This commit is contained in:
Ross Poulton 2012-04-11 17:48:39 +10:00
parent b970f12799
commit 4fb9ab0617

View File

@ -250,10 +250,17 @@ def update_ticket(request, ticket_id, public=False):
public = request.POST.get('public', False) public = request.POST.get('public', False)
owner = int(request.POST.get('owner', None)) owner = int(request.POST.get('owner', None))
priority = int(request.POST.get('priority', ticket.priority)) priority = int(request.POST.get('priority', ticket.priority))
due_date = datetime( due_date_year = request.POST.get('due_date_year', None)
int(request.POST.get('due_date_year')), due_date_month = request.POST.get('due_date_month', None)
int(request.POST.get('due_date_month')), due_date_day = request.POST.get('due_date_day', None)
int(request.POST.get('due_date_day')))
if not (due_date_year and due_date_month and due_date_day):
due_date = ticket.due_date
else:
due_date = datetime(
int(due_date_year),
int(due_date_month),
int(due_date_day))
tags = request.POST.get('tags', '') tags = request.POST.get('tags', '')
# We need to allow the 'ticket' and 'queue' contexts to be applied to the # We need to allow the 'ticket' and 'queue' contexts to be applied to the