Http404 GET /tickets/TKT-99999/
18 ‎گەلاوێژ 2026, 14:40:12

No Ticket matches the given query.

Danyal Soran Sartip 18 Jul 2026
پیشاندانی هەڵەکە
Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\shortcuts.py", line 90, in get_object_or_404
    return queryset.get(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 635, in get
    raise self.model.DoesNotExist(
        "%s matching query does not exist." % self.model._meta.object_name
    )
tickets.models.Ticket.DoesNotExist: Ticket matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\decorators.py", line 117, in _wrapped
    ticket = get_object_or_404(
        Ticket.objects.select_related(
    ...<2 lines>...
        ticket_id=ticket_id,
    )
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\shortcuts.py", line 92, in get_object_or_404
    raise Http404(
        "No %s matches the given query." % queryset.model._meta.object_name
    )
django.http.response.Http404: No Ticket matches the given query.
Http404 GET /tickets/TKT-99999/
18 ‎گەلاوێژ 2026, 14:38:07

No Ticket matches the given query.

Danyal Soran Sartip 18 Jul 2026
پیشاندانی هەڵەکە
Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\shortcuts.py", line 90, in get_object_or_404
    return queryset.get(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 635, in get
    raise self.model.DoesNotExist(
        "%s matching query does not exist." % self.model._meta.object_name
    )
tickets.models.Ticket.DoesNotExist: Ticket matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\decorators.py", line 117, in _wrapped
    ticket = get_object_or_404(
        Ticket.objects.select_related(
    ...<2 lines>...
        ticket_id=ticket_id,
    )
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\shortcuts.py", line 92, in get_object_or_404
    raise Http404(
        "No %s matches the given query." % queryset.model._meta.object_name
    )
django.http.response.Http404: No Ticket matches the given query.
FieldError GET /reports/
18 ‎گەلاوێژ 2026, 14:35:27

Field Ticket.category cannot be both deferred and traversed using select_related at the same time.

Danyal Soran Sartip 18 Jul 2026
پیشاندانی هەڵەکە
Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\decorators.py", line 61, in _wrapped
    return view_func(request, *args, **kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\views\reports.py", line 37, in reports_view
    payload = analytics.dashboard_payload(queryset, days=days)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 436, in dashboard_payload
    'mttr': mttr(tickets),
            ~~~~^^^^^^^^^
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 103, in mttr
    for t in tickets.filter(resolved_at__isnull=False).only('resolved_at', 'created_at')
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 386, in __iter__
    self._fetch_all()
    ~~~~~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 1954, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 93, in __iter__
    results = compiler.execute_sql(
        chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size
    )
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1610, in execute_sql
    sql, params = self.as_sql()
                  ~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 766, in as_sql
    extra_select, order_by, group_by = self.pre_sql_setup(
                                       ~~~~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases or bool(combinator),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 85, in pre_sql_setup
    self.setup_query(with_col_aliases=with_col_aliases)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 74, in setup_query
    self.select, self.klass_info, self.annotation_col_map = self.get_select(
                                                            ~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 299, in get_select
    related_klass_infos = self.get_related_selections(select, select_mask)
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1241, in get_related_selections
    if not select_related_descend(f, restricted, requested, select_mask):
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query_utils.py", line 438, in select_related_descend
    raise FieldError(
    ...<2 lines>...
    )
django.core.exceptions.FieldError: Field Ticket.category cannot be both deferred and traversed using select_related at the same time.
FieldError GET /reports/
18 ‎گەلاوێژ 2026, 14:34:09

Field Ticket.category cannot be both deferred and traversed using select_related at the same time.

Danyal Soran Sartip 18 Jul 2026
پیشاندانی هەڵەکە
Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\decorators.py", line 61, in _wrapped
    return view_func(request, *args, **kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\views\reports.py", line 37, in reports_view
    payload = analytics.dashboard_payload(queryset, days=days)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 436, in dashboard_payload
    'mttr': mttr(tickets),
            ~~~~^^^^^^^^^
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 103, in mttr
    for t in tickets.filter(resolved_at__isnull=False).only('resolved_at', 'created_at')
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 386, in __iter__
    self._fetch_all()
    ~~~~~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 1954, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 93, in __iter__
    results = compiler.execute_sql(
        chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size
    )
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1610, in execute_sql
    sql, params = self.as_sql()
                  ~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 766, in as_sql
    extra_select, order_by, group_by = self.pre_sql_setup(
                                       ~~~~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases or bool(combinator),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 85, in pre_sql_setup
    self.setup_query(with_col_aliases=with_col_aliases)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 74, in setup_query
    self.select, self.klass_info, self.annotation_col_map = self.get_select(
                                                            ~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 299, in get_select
    related_klass_infos = self.get_related_selections(select, select_mask)
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1241, in get_related_selections
    if not select_related_descend(f, restricted, requested, select_mask):
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query_utils.py", line 438, in select_related_descend
    raise FieldError(
    ...<2 lines>...
    )
django.core.exceptions.FieldError: Field Ticket.category cannot be both deferred and traversed using select_related at the same time.
FieldError GET /reports/
18 ‎گەلاوێژ 2026, 14:33:58

Field Ticket.category cannot be both deferred and traversed using select_related at the same time.

Danyal Soran Sartip 18 Jul 2026
پیشاندانی هەڵەکە
Traceback (most recent call last):
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\decorators.py", line 61, in _wrapped
    return view_func(request, *args, **kwargs)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\views\reports.py", line 37, in reports_view
    payload = analytics.dashboard_payload(queryset, days=days)
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 436, in dashboard_payload
    'mttr': mttr(tickets),
            ~~~~^^^^^^^^^
  File "C:\Users\zhany\Desktop\IT help Desk System\tickets\analytics.py", line 103, in mttr
    for t in tickets.filter(resolved_at__isnull=False).only('resolved_at', 'created_at')
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 386, in __iter__
    self._fetch_all()
    ~~~~~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 1954, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query.py", line 93, in __iter__
    results = compiler.execute_sql(
        chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size
    )
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1610, in execute_sql
    sql, params = self.as_sql()
                  ~~~~~~~~~~~^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 766, in as_sql
    extra_select, order_by, group_by = self.pre_sql_setup(
                                       ~~~~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases or bool(combinator),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 85, in pre_sql_setup
    self.setup_query(with_col_aliases=with_col_aliases)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 74, in setup_query
    self.select, self.klass_info, self.annotation_col_map = self.get_select(
                                                            ~~~~~~~~~~~~~~~^
        with_col_aliases=with_col_aliases,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 299, in get_select
    related_klass_infos = self.get_related_selections(select, select_mask)
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\sql\compiler.py", line 1241, in get_related_selections
    if not select_related_descend(f, restricted, requested, select_mask):
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\zhany\AppData\Roaming\Python\Python314\site-packages\django\db\models\query_utils.py", line 438, in select_related_descend
    raise FieldError(
    ...<2 lines>...
    )
django.core.exceptions.FieldError: Field Ticket.category cannot be both deferred and traversed using select_related at the same time.