Would create a 500 when user omitted their email. Only a partial improve. Added a TODO: as this view still breaks if passing non-numeric characters to the ID.
I assume this needs a full overhaul really.
Extract attachment processing from forms, views.staff, and management.command.get_email modules, and consolidate it into a unified lib module function.
Also refactor the affected components, most notably lib.send_templated_email, to make it easier (IMO) to reason about changes to them.
Add unit tests for attachments with UTF-8 filenames, and functional tests for submission of same, as well as ASCII versions, through the public ticket-form.
Remove unused Attachment method "get_upload_to".
My browser sends 'on' when a checkbox is ticked, django ORM only
recognises '1', 'true' or 't' as valid 'True' responses.
This throws an error
ValidationError at /helpdesk/save_query/
[u"'on' value must be either True or False."]
This could be fixed with " value='1'" in the template, but testing that is harder
My fix is to add a check in the view. 2 more lines, but easier to unittest.
Core devs need to make a call as to which solution is best.
D
ignores the queue name. This means that queue changes on a ticket dont
break the email links which have already been sent out.
The queue name still exists in the link/url, but is not used in the
lookup
Without this change, django1.10 is missing the 'user' object from the context, which results in
a very hard to track down bug manifesting in ;
"NoReverseMatch: Reverse for 'helpdesk_rss_user' with arguments '('',)' and keyword arguments '{}' not found."
At first glance users may think this is the dots-in-usernames bug, but the username is totally missing.
- use of patterns() in urls.py is deprecated
- render() functions accept only dicts - introduced checks to ensure downward compatibility back to Django 1.7
If HELPDESK_ENABLE_PER_QUEUE_STAFF_MEMBERSHIP was True but a user had
no QueueMembership entries, then restricting queue access generated
RelatedObjectDoesNotExist exceptions.
- Ask for forgiveness whenever we try to limit a queryset by the
queuemembership related object set.
- Since tests can now be run with the project's settings active,
rather than only with quicktest.py's settings, restore the initial
HELPDESK_ENABLE_PER_QUEUE_MEMBERSHIP value after having tested the
related functionality.