mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: priority filtering (#1398)
This commit is contained in:
parent
c89592d587
commit
ae051b28af
@ -1,7 +1,6 @@
|
|||||||
from django.utils.timezone import make_aware
|
from django.utils.timezone import make_aware
|
||||||
from django.utils.dateparse import parse_datetime
|
from django.utils.dateparse import parse_datetime
|
||||||
|
|
||||||
|
|
||||||
def filter_state(params, filter, method):
|
def filter_state(params, filter, method):
|
||||||
if method == "GET":
|
if method == "GET":
|
||||||
states = params.get("state").split(",")
|
states = params.get("state").split(",")
|
||||||
@ -26,12 +25,27 @@ def filter_estimate_point(params, filter, method):
|
|||||||
|
|
||||||
def filter_priority(params, filter, method):
|
def filter_priority(params, filter, method):
|
||||||
if method == "GET":
|
if method == "GET":
|
||||||
priorties = params.get("priority").split(",")
|
priorities = params.get("priority").split(",")
|
||||||
if len(priorties) and "" not in priorties:
|
if len(priorities) and "" not in priorities:
|
||||||
filter["priority__in"] = priorties
|
if len(priorities) == 1 and "null" in priorities:
|
||||||
|
filter["priority__isnull"] = True
|
||||||
|
elif len(priorities) > 1 and "null" in priorities:
|
||||||
|
filter["priority__isnull"] = True
|
||||||
|
filter["priority__in"] = [p for p in priorities if p != "null"]
|
||||||
|
else:
|
||||||
|
filter["priority__in"] = [p for p in priorities if p != "null"]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if params.get("priority", None) and len(params.get("priority")):
|
if params.get("priority", None) and len(params.get("priority")):
|
||||||
filter["priority__in"] = params.get("priority")
|
priorities = params.get("priority")
|
||||||
|
if len(priorities) == 1 and "null" in priorities:
|
||||||
|
filter["priority__isnull"] = True
|
||||||
|
elif len(priorities) > 1 and "null" in priorities:
|
||||||
|
filter["priority__isnull"] = True
|
||||||
|
filter["priority__in"] = [p for p in priorities if p != "null"]
|
||||||
|
else:
|
||||||
|
filter["priority__in"] = [p for p in priorities if p != "null"]
|
||||||
|
|
||||||
return filter
|
return filter
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user