Fixing bug in get_total_closed_milestones

remotes/origin/logger
Alejandro Alonso 2016-01-14 11:13:01 +01:00 committed by David Barragán Merino
parent 2a970c0205
commit 1a341f7252
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ class ProjectSerializer(FanResourceSerializerMixin, WatchedResourceModelSerializ
# The "closed_milestone" attribute can be attached in the get_queryset method of the viewset.
qs_closed_milestones = getattr(obj, "closed_milestones", None)
if qs_closed_milestones is not None:
return qs_closed_milestones
return len(qs_closed_milestones)
return obj.milestones.filter(closed=True).count()