mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
RRS: ensure default URLs for release/milestone are the latest
In the "Maintenance Plan" drop-down the maintenance plans point to the "default" release and milestone, but it was picking the most recently added record in the database rather than the latest one by date. Use an order_by() to ensure we get the most recent release/milestone by date rather than just the most recently added in case they have been added out-of-order. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
869ebec108
commit
9cdd341cfd
|
@ -33,7 +33,7 @@ class MaintenancePlan(models.Model):
|
|||
maintainer_style = models.CharField(max_length=1, choices=MAINTENANCEPLAN_MAINTAINER_STYLE, default='L', help_text='Maintainer tracking style for the layers within this plan')
|
||||
|
||||
def get_default_release(self):
|
||||
return self.release_set.filter(milestone__isnull=False).last()
|
||||
return self.release_set.filter(milestone__isnull=False).order_by('-start_date').first()
|
||||
|
||||
def per_recipe_maintainers(self):
|
||||
return self.maintainer_style != 'L'
|
||||
|
@ -63,7 +63,7 @@ class Release(models.Model):
|
|||
unique_together = ('plan', 'name',)
|
||||
|
||||
def get_default_milestone(self):
|
||||
return self.milestone_set.last()
|
||||
return self.milestone_set.order_by('-start_date').first()
|
||||
|
||||
@staticmethod
|
||||
def get_by_date(maintplan, date):
|
||||
|
|
Loading…
Reference in New Issue
Block a user