Skip to content

Commit

Permalink
Add support for "unknown" in the is_reachable filter #103
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Dec 10, 2024
1 parent e335a16 commit b93d53d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PIP_ARGS=--find-links=./thirdparty/dist/ --no-index --no-cache-dir
ENV_FILE=.env
DOCS_LOCATION=./docs
DOCKER_COMPOSE=docker compose -f docker-compose.yml
DOCKER_EXEC=${DOCKER_COMPOSE} eUSERNAMExec
DOCKER_EXEC=${DOCKER_COMPOSE} exec
DB_NAME=dejacode_db
DB_USERNAME=dejacode
DB_PASSWORD=dejacode
Expand Down
2 changes: 2 additions & 0 deletions dje/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ def filter(self, qs, value):
boolean_value = {"yes": True, "no": False}.get(value)
if boolean_value is not None:
return qs.filter(**{self.field_name: boolean_value}).distinct()
elif value in ["none", "unknown"]:
return qs.filter(**{f"{self.field_name}__isnull": True}).distinct()
return qs


Expand Down

0 comments on commit b93d53d

Please sign in to comment.