mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 02:10:49 +01:00
* Errors with invalid page number for paginaton code * Comment / Resolution not always saved.
This commit is contained in:
parent
b492bd5bd2
commit
81591fdb40
1
forms.py
1
forms.py
@ -132,6 +132,7 @@ class TicketForm(forms.Form):
|
|||||||
context = {
|
context = {
|
||||||
'ticket': t,
|
'ticket': t,
|
||||||
'queue': q,
|
'queue': q,
|
||||||
|
'comment': f.comment,
|
||||||
}
|
}
|
||||||
|
|
||||||
messages_sent_to = []
|
messages_sent_to = []
|
||||||
|
@ -14,7 +14,7 @@ from django.contrib.auth.models import User
|
|||||||
from django.contrib.auth.decorators import login_required, user_passes_test
|
from django.contrib.auth.decorators import login_required, user_passes_test
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.core.paginator import Paginator
|
from django.core import paginator
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.http import HttpResponseRedirect, Http404, HttpResponse, HttpResponseForbidden
|
from django.http import HttpResponseRedirect, Http404, HttpResponse, HttpResponseForbidden
|
||||||
@ -235,11 +235,12 @@ def update_ticket(request, ticket_id, public=False):
|
|||||||
|
|
||||||
messages_sent_to = []
|
messages_sent_to = []
|
||||||
|
|
||||||
|
context.update(
|
||||||
|
resolution=ticket.resolution,
|
||||||
|
comment=f.comment,
|
||||||
|
)
|
||||||
|
|
||||||
if ticket.submitter_email and public and (f.comment or (f.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS))):
|
if ticket.submitter_email and public and (f.comment or (f.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS))):
|
||||||
context.update(
|
|
||||||
resolution=ticket.resolution,
|
|
||||||
comment=f.comment,
|
|
||||||
)
|
|
||||||
|
|
||||||
if f.new_status == Ticket.RESOLVED_STATUS:
|
if f.new_status == Ticket.RESOLVED_STATUS:
|
||||||
template = 'resolved_submitter'
|
template = 'resolved_submitter'
|
||||||
@ -504,16 +505,16 @@ def ticket_list(request):
|
|||||||
query_params['sortreverse'] = sortreverse
|
query_params['sortreverse'] = sortreverse
|
||||||
|
|
||||||
ticket_qs = apply_query(Ticket.objects.select_related(), query_params)
|
ticket_qs = apply_query(Ticket.objects.select_related(), query_params)
|
||||||
paginator = Paginator(ticket_qs, request.user.usersettings.settings.get('tickets_per_page', 20))
|
ticket_paginator = paginator.Paginator(ticket_qs, request.user.usersettings.settings.get('tickets_per_page', 20))
|
||||||
try:
|
try:
|
||||||
page = int(request.GET.get('page', '1'))
|
page = int(request.GET.get('page', '1'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
page = 1
|
page = 1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tickets = paginator.page(page)
|
tickets = ticket_paginator.page(page)
|
||||||
except (EmptyPage, InvalidPage):
|
except (paginator.EmptyPage, paginator.InvalidPage):
|
||||||
tickets = paginator.page(paginator.num_pages)
|
tickets = ticket_paginator.page(ticket_paginator.num_pages)
|
||||||
|
|
||||||
search_message = ''
|
search_message = ''
|
||||||
if context.has_key('query') and settings.DATABASE_ENGINE.startswith('sqlite'):
|
if context.has_key('query') and settings.DATABASE_ENGINE.startswith('sqlite'):
|
||||||
|
Loading…
Reference in New Issue
Block a user