Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 15, 2024
1 parent 663d198 commit d294d3e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions uniticket/uni_ticket/views/datatables.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,31 @@ def get_queryset(self):
structure = params["structure"]
if year:
if year.isnumeric():
self.aqs = self.aqs.filter(ticket__created__year=year)
self.aqs = self.aqs.filter(created__year=year)
else:
days = 7 if year == "last_week" else 30
delta_day = get_datetime_delta(days=days)
self.aqs = self.aqs.filter(ticket__created__gte=delta_day)
self.aqs = self.aqs.filter(created__gte=delta_day)
if category:
self.aqs = self.aqs.filter(
ticket__input_module__ticket_category__slug=category,
ticket__input_module__ticket_category__organizational_structure__slug=structure,
input_module__ticket_category__slug=category,
input_module__ticket_category__organizational_structure__slug=structure,
)
if text:
self.aqs = self.aqs.filter(
Q(ticket__code__icontains=text)
| Q(ticket__subject__icontains=text)
| Q(ticket__description__icontains=text)
| Q(ticket__created_by__first_name__icontains=text)
| Q(ticket__created_by__last_name__icontains=text)
| Q(ticket__compiled_by__first_name__icontains=text)
| Q(ticket__compiled_by__last_name__icontains=text)
Q(code__icontains=text)
| Q(subject__icontains=text)
| Q(description__icontains=text)
| Q(created_by__first_name__icontains=text)
| Q(created_by__last_name__icontains=text)
| Q(compiled_by__first_name__icontains=text)
| Q(compiled_by__last_name__icontains=text)
#| Q(taken_by__first_name__icontains=text)
#| Q(taken_by__last_name__icontains=text)
| Q(ticket__closed_by__first_name__icontains=text)
| Q(ticket__closed_by__last_name__icontains=text)
| Q(ticket__input_module__ticket_category__name__icontains=text)
| Q(ticket__created__icontains=text)
| Q(closed_by__first_name__icontains=text)
| Q(closed_by__last_name__icontains=text)
| Q(input_module__ticket_category__name__icontains=text)
| Q(created__icontains=text)
)

def fill_data(self):
Expand Down

0 comments on commit d294d3e

Please sign in to comment.