diff --git a/hypha/apply/determinations/models.py b/hypha/apply/determinations/models.py index faa8a69bab579cafbed6dd84f8e7b1fe03b2092d..237d0d73b0b54557546725396004bd3ea818d1af 100644 --- a/hypha/apply/determinations/models.py +++ b/hypha/apply/determinations/models.py @@ -28,12 +28,16 @@ from .options import ACCEPTED, DETERMINATION_CHOICES, REJECTED class DeterminationQuerySet(models.QuerySet): + def staff(self): + # Designed to be used with a queryset related to submissions + return self.all().order_by('-updated_at') + def active(self): # Designed to be used with a queryset related to submissions - return self.get(is_draft=True) + return self.get(is_draft=True).order_by('-updated_at') def submitted(self): - return self.filter(is_draft=False) + return self.filter(is_draft=False).order_by('-updated_at') def final(self): return self.submitted().filter(outcome__in=[ACCEPTED, REJECTED]) diff --git a/hypha/apply/determinations/templates/determinations/includes/determination_block.html b/hypha/apply/determinations/templates/determinations/includes/determination_block.html index 26da899c4d8c24bcc57a7c69b9728502d2efec28..4987a0a5352674b2acc6cba88c6fd5f010628e4d 100644 --- a/hypha/apply/determinations/templates/determinations/includes/determination_block.html +++ b/hypha/apply/determinations/templates/determinations/includes/determination_block.html @@ -1,7 +1,7 @@ {% load humanize determination_tags %} <div class="sidebar__inner"> <h5>Determinations</h5> - {% for determination in object.determinations.all %} + {% for determination in object.determinations.staff %} <p> <a class="link link--bold" href="{% url 'apply:submissions:determinations:detail' submission_pk=object.id pk=determination.id %}"> {% if determination.is_draft %}[Draft] {% endif %}{{ determination.get_outcome_display }}