You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing the version 2.8.1 to see if it's safe to use (base on #894), I found that with the new code for optimizing loading of schedules, the method DatabaseScheduler._get_unique_timezone_names was added, but without fields, distinct uses all of them. This should be written as:
def _get_unique_timezone_names(self):
"""Get a list of all unique timezone names used in CrontabSchedule"""
return CrontabSchedule.objects.values_list(
'timezone', flat=True
).order_by('timezone').distinct('timezone')
NOTE: order_by needed for the distinct to work correctly.
Without the change, that method returns multiple of the same timezones.