Skip to content

Commit

Permalink
Refactor ShiftFeed items method to filter shifts with non-null registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
Tubo committed Dec 29, 2023
1 parent ba90e19 commit b5604d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions radscheduler/core/ical.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class ShiftFeed(ICalFeed):
timezone = "Pacific/Auckland"

def items(self):
return Shift.objects.filter(date__gte=date.today() - timedelta(days=365)).select_related(
"registrar", "registrar__user"
)
return Shift.objects.filter(
date__gte=date.today() - timedelta(days=365), registrar__isnull=False
).select_related("registrar", "registrar__user")

def item_title(self, shift):
result = f"{shift.type}: {shift.registrar.user.username}"
Expand Down

0 comments on commit b5604d3

Please sign in to comment.