Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
refactor(statistics-qs): adjust function signature to not allow *args
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Apr 18, 2024
1 parent a7079e4 commit 0425fdd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions timed/reports/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,7 @@ def __init__(self, catch_prefixes, *args, base_qs=None, agg_filters=None, **kwar
self._agg_filters = agg_filters
self._catch_prefixes = catch_prefixes

def filter(self, *args, **kwargs):
if args: # pragma: no cover
# This is a check against programming errors, no need to test
msg = (
"Unable to detect statistics filter type form Q objects. use "
"filter_aggregate() or filter_base() instead"
)
raise RuntimeError(msg)
def filter(self, /, **kwargs):
my_filters = {
k: v for k, v in kwargs.items() if not k.startswith(self._catch_prefixes)
}
Expand Down

0 comments on commit 0425fdd

Please sign in to comment.