Enable ?page_size=1 in URL to fetch correct objects on schedules endpoint

This commit is contained in:
beeankha
2021-03-29 11:52:20 -04:00
parent ba2fd6f801
commit 675286c1ac
2 changed files with 19 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ class ScheduleManager(ScheduleFilterMethods, models.Manager):
class Schedule(PrimordialModel, LaunchTimeConfig):
class Meta:
app_label = 'main'
ordering = ['-next_run']
ordering = [models.F('next_run').desc(nulls_last=True), 'id']
unique_together = ('unified_job_template', 'name')
objects = ScheduleManager()