Skip to content

Commit

Permalink
Merge pull request #409 from jdufresne/prefetch-workaround
Browse files Browse the repository at this point in the history
Remove workaround for older prefetch_related_objects() API
  • Loading branch information
llazzaro committed Feb 5, 2018
2 parents 6fd7c61 + 5a1df00 commit 9340f93
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions schedule/periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ def _get_sorted_occurrences(self):
occurrences.append(occurrence)
return occurrences

try:
prefetch_related_objects(self.events, 'occurrence_set')
except AttributeError:
prefetch_related_objects(self.events, ['occurrence_set'])
prefetch_related_objects(self.events, 'occurrence_set')
for event in self.events:
event_occurrences = event.get_occurrences(self.start, self.end, clear_prefetch=False)
occurrences += event_occurrences
Expand Down

0 comments on commit 9340f93

Please sign in to comment.