Skip to content

Commit

Permalink
Only intersect for incidents
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 committed Sep 28, 2023
1 parent f2fc6f1 commit 2afff1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dispatch/database/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,13 @@ def search_filter_sort_paginate(
query = search(query_str=query_str, query=query, model=model, sort=sort)

query_restricted = apply_model_specific_filters(model_cls, query, current_user, role)
query = query.distinct()

if filter_spec:
query = apply_filter_specific_joins(model_cls, filter_spec, query)
query = apply_filters(query, filter_spec, model_cls)

query = query.intersect(query_restricted)
if model == "Incident":
query = query.intersect(query_restricted)

if sort_by:
sort_spec = create_sort_spec(model, sort_by, descending)
Expand Down

0 comments on commit 2afff1c

Please sign in to comment.