Skip to content

Commit

Permalink
fix: Add explicit pagination to change requests (#4925)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan authored Dec 17, 2024
1 parent bfa4614 commit cafb663
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.17 on 2024-12-16 16:49

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("workflows_core", "0011_add_project_to_change_requests"),
]

operations = [
migrations.AlterModelOptions(
name="changerequest",
options={"ordering": ("id",)},
),
]
4 changes: 4 additions & 0 deletions api/features/workflows/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class ChangeRequest(

ignore_conflicts = models.BooleanField(default=False)

class Meta:
# Explicit ordering to prevent pagination warnings.
ordering = ("id",)

def approve(self, user: "FFAdminUser"):
if user.id == self.user_id:
raise CannotApproveOwnChangeRequest(
Expand Down

0 comments on commit cafb663

Please sign in to comment.