From 611e6de92843c5e91b09d01a576e467b17c8fb9d Mon Sep 17 00:00:00 2001 From: Jachym Cepicky Date: Wed, 22 May 2019 11:20:01 +0200 Subject: [PATCH] fix for the issue #145 --- helpdesk/forms.py | 2 ++ helpdesk/views/staff.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/forms.py b/helpdesk/forms.py index 2fc4479f..f2c203f5 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -166,6 +166,7 @@ class AbstractTicketForm(CustomFieldMixin, forms.Form): due_date = forms.DateTimeField( widget=forms.TextInput(attrs={'class': 'form-control'}), required=False, + input_formats=['%d/%m/%Y', '%m/%d/%Y', "%d.%m.%Y", ], label=_('Due on'), ) @@ -287,6 +288,7 @@ class TicketForm(AbstractTicketForm): self.fields['assigned_to'].choices = [('', '--------')] + [(u.id, u.get_username()) for u in assignable_users] self._add_form_custom_fields() + def save(self, user=None): """ Writes and returns a Ticket() object diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 8e956de3..bcb748b6 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -1012,7 +1012,8 @@ def datatables_ticket_list(request): serializers.py. The serializers and this view use django-rest_framework methods """ try: - model_object = query_tickets_by_args(cache.get('ticket_qs'), '-date_created', **request.query_params) + objects = cache.get('ticket_qs') + model_object = query_tickets_by_args(objects, '-date_created', **request.query_params) serializer = TicketSerializer(model_object['items'], many=True) result = dict() result['data'] = serializer.data