forked from github/plane
fix: state ordering in group
This commit is contained in:
parent
ec37bb9d23
commit
2d2751c58d
@ -38,4 +38,13 @@ class State(ProjectBaseModel):
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.slug = slugify(self.name)
|
||||
if self._state.adding:
|
||||
# Get the maximum sequence value from the database
|
||||
last_id = State.objects.filter(project=self.project).aggregate(
|
||||
largest=models.Max("sequence")
|
||||
)["largest"]
|
||||
# if last_id is not None
|
||||
if last_id is not None:
|
||||
self.sequence = last_id + 15000
|
||||
|
||||
return super().save(*args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user