~launchpad-pqm/python-oops-tools/trunk

« back to all changes in this revision

Viewing changes to src/oopstools/scripts/prune.py

  • Committer: Haw Loeung
  • Date: 2017-07-07 05:42:40 UTC
  • mfrom: (56.1.1 python-oops-tools)
  • Revision ID: haw.loeung@canonical.com-20170707054240-9t0e0d13mp7ayrr5
[wgrant] Fix prune to find oldest OOPS by date, not by ID.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    except IndexError:
100
100
        # Never been pruned.
101
101
        try:
102
 
            oldest_oops = Oops.objects.order_by('id')[0]
 
102
            oldest_oops = Oops.objects.order_by('date')[0]
103
103
        except IndexError:
104
104
            # And has no oopses
105
105
            return 0