Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions apiserver/plane/app/views/module/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,7 @@ def list(self, request, slug, project_id):
)
return Response(modules, status=status.HTTP_200_OK)

allow_permission(
[
ROLE.ADMIN,
ROLE.MEMBER,
]
)

@allow_permission([ROLE.ADMIN, ROLE.MEMBER])
def retrieve(self, request, slug, project_id, pk):
queryset = (
self.get_queryset()
Expand Down Expand Up @@ -672,7 +666,13 @@ def retrieve(self, request, slug, project_id, pk):
"labels": label_distribution,
"completion_chart": {},
}
if modules and modules.start_date and modules.target_date:

if (
modules
and modules.start_date
and modules.target_date
and modules.total_issues > 0
):
data["distribution"]["completion_chart"] = burndown_plot(
queryset=modules,
slug=slug,
Expand Down
2 changes: 1 addition & 1 deletion apiserver/plane/utils/analytics_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def burndown_plot(
if module_id:
# Get all dates between the two dates
date_range = [
(queryset.start_date + timedelta(days=x)).date()
(queryset.start_date + timedelta(days=x))
for x in range(
(queryset.target_date - queryset.start_date).days + 1
)
Expand Down