mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
Enable ?page_size=1 in URL to fetch correct objects on schedules endpoint
This commit is contained in:
18
awx/main/migrations/0135_schedule_sort_fallback_to_id.py
Normal file
18
awx/main/migrations/0135_schedule_sort_fallback_to_id.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2.16 on 2021-03-29 15:30
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import django.db.models.expressions
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('main', '0134_unifiedjob_ansible_version'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='schedule',
|
||||||
|
options={'ordering': [django.db.models.expressions.OrderBy(django.db.models.expressions.F('next_run'), descending=True, nulls_last=True), 'id']},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -63,7 +63,7 @@ class ScheduleManager(ScheduleFilterMethods, models.Manager):
|
|||||||
class Schedule(PrimordialModel, LaunchTimeConfig):
|
class Schedule(PrimordialModel, LaunchTimeConfig):
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
ordering = ['-next_run']
|
ordering = [models.F('next_run').desc(nulls_last=True), 'id']
|
||||||
unique_together = ('unified_job_template', 'name')
|
unique_together = ('unified_job_template', 'name')
|
||||||
|
|
||||||
objects = ScheduleManager()
|
objects = ScheduleManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user