Merge pull request #222 from issackelly/master

Custom User model changes.Also closes #221. Thanks!
This commit is contained in:
Ross Poulton 2014-07-16 13:54:41 +10:00
commit 3bd2d67193
5 changed files with 15 additions and 7 deletions

View File

@ -86,6 +86,10 @@ These changes are visible throughout django-helpdesk
**Default:** ``HELPDESK_AUTO_SUBSCRIBE_ON_TICKET_RESPONSE = False``
- **HELPDESK_EMAIL_SUBJECT_TEMPLATE ** Subject template for templated emails. ``%(subject)s`` represents the subject wording from the email template (e.g. "(Closed)").
**Default:** ``HELPDESK_EMAIL_SUBJECT_TEMPLATE = "{{ ticket.ticket }} {{ ticket.title|safe }} %(subject)s"``
Options shown on public pages
-----------------------------

View File

@ -104,8 +104,9 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
).render(context)
subject_part = loader.get_template_from_string(
"{{ ticket.ticket }} {{ ticket.title|safe }} %s" % t.subject
).render(context)
settings.HELPDESK_EMAIL_SUBJECT_TEMPLATE % {
"subject": t.subject,
}).render(context)
if isinstance(recipients,(str,unicode)):
if recipients.find(','):

View File

@ -80,6 +80,9 @@ HELPDESK_STAFF_ONLY_TICKET_OWNERS = getattr(settings, 'HELPDESK_STAFF_ONLY_TICKE
HELPDESK_STAFF_ONLY_TICKET_CC = getattr(settings, 'HELPDESK_STAFF_ONLY_TICKET_CC', False)
# allow the subject to have a configurable template.
HELPDESK_EMAIL_SUBJECT_TEMPLATE = getattr(settings, 'HELPDESK_EMAIL_SUBJECT_TEMPLATE', "{{ ticket.ticket }} {{ ticket.title|safe }} %(subject)s")
''' options for staff.create_ticket view '''
# hide the 'assigned to' / 'Case owner' field from the 'create_ticket' view?

View File

@ -160,11 +160,11 @@ urlpatterns += patterns('helpdesk.views.public',
)
urlpatterns += patterns('',
url(r'^rss/user/(?P<user_name>[\.\@A-Za-z0-9_-]+)/$',
url(r'^rss/user/(?P<user_name>[^/]+)/$',
login_required(feeds.OpenTicketsByUser()),
name='helpdesk_rss_user'),
url(r'^rss/user/(?P<user_name>[\.\@A-Za-z0-9_-]+)/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
url(r'^rss/user/(?P<user_name>[^/]+)/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
login_required(feeds.OpenTicketsByUser()),
name='helpdesk_rss_user_queue'),

View File

@ -237,9 +237,9 @@ def view_ticket(request, ticket_id):
return update_ticket(request, ticket_id)
if helpdesk_settings.HELPDESK_STAFF_ONLY_TICKET_OWNERS:
users = User.objects.filter(is_active=True, is_staff=True).order_by('username')
users = User.objects.filter(is_active=True, is_staff=True).order_by(User.USERNAME_FIELD)
else:
users = User.objects.filter(is_active=True).order_by('username')
users = User.objects.filter(is_active=True).order_by(User.USERNAME_FIELD)
# TODO: shouldn't this template get a form to begin with?