Skip to content

Commit

Permalink
Moving into condition
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 committed Sep 29, 2023
1 parent 2afff1c commit a81baa8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/dispatch/database/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,12 @@ def search_filter_sort_paginate(
sort = False if sort_by else True
query = search(query_str=query_str, query=query, model=model, sort=sort)

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

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

if model == "Incident":
query_restricted = apply_model_specific_filters(model_cls, query, current_user, role)
query = query.intersect(query_restricted)

if sort_by:
Expand Down

0 comments on commit a81baa8

Please sign in to comment.