Skip to content

Commit

Permalink
don't consider staled a mission with a future end date
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalfox committed Feb 21, 2025
1 parent 8cdc9e4 commit bf9ee01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions people/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django.urls import reverse
from django.views.decorators.cache import cache_page
from django.utils.translation import gettext as _
from django.db.models import Count, Sum, Min, F, Avg
from django.db.models import Count, Sum, Min, F, Avg, Q
from django.db.models.functions import TruncMonth
from django.conf import settings

Expand Down Expand Up @@ -66,7 +66,7 @@ def consultant_detail(request, consultant_id):
# Compute consultant current production mission based on forecast and responsibility
missions = consultant.current_missions().filter(nature="PROD")
# Identify staled missions that may need new staffing or archiving
staled_missions = [m for m in missions if m.no_more_staffing_since()]
staled_missions = [m for m in missions.filter(Q(end_date__lt=date.today()) | Q(end_date__isnull=True)) if m.no_more_staffing_since()]
# Timesheet donut data
holidays = [h.day for h in Holiday.objects.all()]
month_days = working_days(month, holidays, upToToday=False)
Expand Down

0 comments on commit bf9ee01

Please sign in to comment.