mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: changed issue priority from NULL to none (#2142)
* chore: changed issue priority from NULL to none * fix: deleted the migration file
This commit is contained in:
parent
6867154963
commit
9bff10de6d
@ -178,7 +178,7 @@ class IssueViewSet(BaseViewSet):
|
|||||||
filters = issue_filters(request.query_params, "GET")
|
filters = issue_filters(request.query_params, "GET")
|
||||||
|
|
||||||
# Custom ordering for priority and state
|
# Custom ordering for priority and state
|
||||||
priority_order = ["urgent", "high", "medium", "low", None]
|
priority_order = ["urgent", "high", "medium", "low", "none"]
|
||||||
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
||||||
|
|
||||||
order_by_param = request.GET.get("order_by", "-created_at")
|
order_by_param = request.GET.get("order_by", "-created_at")
|
||||||
@ -331,7 +331,7 @@ class UserWorkSpaceIssues(BaseAPIView):
|
|||||||
try:
|
try:
|
||||||
filters = issue_filters(request.query_params, "GET")
|
filters = issue_filters(request.query_params, "GET")
|
||||||
# Custom ordering for priority and state
|
# Custom ordering for priority and state
|
||||||
priority_order = ["urgent", "high", "medium", "low", None]
|
priority_order = ["urgent", "high", "medium", "low", "none"]
|
||||||
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
||||||
|
|
||||||
order_by_param = request.GET.get("order_by", "-created_at")
|
order_by_param = request.GET.get("order_by", "-created_at")
|
||||||
@ -1068,7 +1068,7 @@ class IssueArchiveViewSet(BaseViewSet):
|
|||||||
show_sub_issues = request.GET.get("show_sub_issues", "true")
|
show_sub_issues = request.GET.get("show_sub_issues", "true")
|
||||||
|
|
||||||
# Custom ordering for priority and state
|
# Custom ordering for priority and state
|
||||||
priority_order = ["urgent", "high", "medium", "low", None]
|
priority_order = ["urgent", "high", "medium", "low", "none"]
|
||||||
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
||||||
|
|
||||||
order_by_param = request.GET.get("order_by", "-created_at")
|
order_by_param = request.GET.get("order_by", "-created_at")
|
||||||
@ -2078,7 +2078,7 @@ class ProjectIssuesPublicEndpoint(BaseAPIView):
|
|||||||
filters = issue_filters(request.query_params, "GET")
|
filters = issue_filters(request.query_params, "GET")
|
||||||
|
|
||||||
# Custom ordering for priority and state
|
# Custom ordering for priority and state
|
||||||
priority_order = ["urgent", "high", "medium", "low", None]
|
priority_order = ["urgent", "high", "medium", "low", "none"]
|
||||||
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
|
||||||
|
|
||||||
order_by_param = request.GET.get("order_by", "-created_at")
|
order_by_param = request.GET.get("order_by", "-created_at")
|
||||||
|
@ -1072,7 +1072,7 @@ class WorkspaceUserProfileStatsEndpoint(BaseAPIView):
|
|||||||
.order_by("state_group")
|
.order_by("state_group")
|
||||||
)
|
)
|
||||||
|
|
||||||
priority_order = ["urgent", "high", "medium", "low", None]
|
priority_order = ["urgent", "high", "medium", "low", "none"]
|
||||||
|
|
||||||
priority_distribution = (
|
priority_distribution = (
|
||||||
Issue.issue_objects.filter(
|
Issue.issue_objects.filter(
|
||||||
|
@ -38,6 +38,7 @@ class Issue(ProjectBaseModel):
|
|||||||
("high", "High"),
|
("high", "High"),
|
||||||
("medium", "Medium"),
|
("medium", "Medium"),
|
||||||
("low", "Low"),
|
("low", "Low"),
|
||||||
|
("none", "None")
|
||||||
)
|
)
|
||||||
parent = models.ForeignKey(
|
parent = models.ForeignKey(
|
||||||
"self",
|
"self",
|
||||||
@ -64,8 +65,7 @@ class Issue(ProjectBaseModel):
|
|||||||
max_length=30,
|
max_length=30,
|
||||||
choices=PRIORITY_CHOICES,
|
choices=PRIORITY_CHOICES,
|
||||||
verbose_name="Issue Priority",
|
verbose_name="Issue Priority",
|
||||||
null=True,
|
default="none",
|
||||||
blank=True,
|
|
||||||
)
|
)
|
||||||
start_date = models.DateField(null=True, blank=True)
|
start_date = models.DateField(null=True, blank=True)
|
||||||
target_date = models.DateField(null=True, blank=True)
|
target_date = models.DateField(null=True, blank=True)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
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(",")
|
||||||
@ -23,7 +24,6 @@ def filter_state_group(params, filter, method):
|
|||||||
return filter
|
return filter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def filter_estimate_point(params, filter, method):
|
def filter_estimate_point(params, filter, method):
|
||||||
if method == "GET":
|
if method == "GET":
|
||||||
estimate_points = params.get("estimate_point").split(",")
|
estimate_points = params.get("estimate_point").split(",")
|
||||||
@ -39,25 +39,10 @@ def filter_priority(params, filter, method):
|
|||||||
if method == "GET":
|
if method == "GET":
|
||||||
priorities = params.get("priority").split(",")
|
priorities = params.get("priority").split(",")
|
||||||
if len(priorities) and "" not in priorities:
|
if len(priorities) and "" not in priorities:
|
||||||
if len(priorities) == 1 and "null" in priorities:
|
filter["priority__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")):
|
||||||
priorities = params.get("priority")
|
filter["priority__in"] = 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
|
||||||
|
|
||||||
|
|
||||||
@ -229,7 +214,6 @@ def filter_issue_state_type(params, filter, method):
|
|||||||
return filter
|
return filter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def filter_project(params, filter, method):
|
def filter_project(params, filter, method):
|
||||||
if method == "GET":
|
if method == "GET":
|
||||||
projects = params.get("project").split(",")
|
projects = params.get("project").split(",")
|
||||||
|
Loading…
Reference in New Issue
Block a user