Skip to content

Commit

Permalink
fix: datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 9, 2023
1 parent 535b7b0 commit 55d043d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uniticket/uni_ticket/views/datatables.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def fill_data(self):
if not self.fqs:
self.get_paging()

self.fqs = Ticket.objects.filter(code__in=list(self.fqs))\
self.fqs = Ticket.objects.filter(code__in=self.fqs)\
.select_related('created_by',
'compiled_by',
'input_module__ticket_category',
Expand All @@ -95,7 +95,8 @@ def fill_data(self):
cleaned_data = []
for e in self.columns:
# this avoid null json value
v = getattr(r, e)
# v = getattr(r, e)
v = r.get(e, None) if type(r) == dict else getattr(r,e)
if v:
if isinstance(v, datetime.datetime):
default_datetime_format = settings.DEFAULT_DATETIME_FORMAT
Expand Down

0 comments on commit 55d043d

Please sign in to comment.