mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Enable ?page_size=1 in URL to fetch correct objects on schedules endpoint
This commit is contained in:
parent
ba2fd6f801
commit
675286c1ac
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 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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user