Revision a75dbd7b snf-astakos-app/astakos/im/models.py

b/snf-astakos-app/astakos/im/models.py
1456 1456
            uplimit = p.get('uplimit', 0)
1457 1457
            self.add_resource_policy(service, resource, uplimit)
1458 1458

  
1459
    def pending_modifications(self):
1459
    def pending_modifications_incl_me(self):
1460 1460
        q = self.chained_applications()
1461
        q = q.filter(~Q(id=self.id) & Q(state=self.PENDING))
1462
        q = q.order_by('id')
1461
        q = q.filter(Q(state=self.PENDING))
1463 1462
        return q
1464 1463

  
1464
    def last_pending_incl_me(self):
1465
        try:
1466
            return self.pending_modifications_incl_me().order_by('-id')[0]
1467
        except IndexError:
1468
            return None
1469

  
1470
    def pending_modifications(self):
1471
        return self.pending_modifications_incl_me().filter(~Q(id=self.id))
1472

  
1465 1473
    def last_pending(self):
1466 1474
        try:
1467 1475
            return self.pending_modifications().order_by('-id')[0]

Also available in: Unified diff