diff --git a/core/tickets/serializers.py b/core/tickets/serializers.py index f954130..0dd797c 100644 --- a/core/tickets/serializers.py +++ b/core/tickets/serializers.py @@ -62,7 +62,12 @@ class IssueSerializer(serializers.ModelSerializer): if self.state_changes.count() > 0 else None last_comment = self.comments.order_by('-timestamp').first().timestamp if self.comments.count() > 0 else None last_mail = self.emails.order_by('-timestamp').first().timestamp if self.emails.count() > 0 else None - args = [x for x in [last_state_change, last_comment, last_mail] if x is not None] + last_assignment = self.assignments.order_by('-timestamp').first().timestamp if \ + self.assignments.count() > 0 else None + last_relation = self.item_relations.order_by('-timestamp').first().timestamp if \ + self.item_relations.count() > 0 else None + args = [x for x in [last_state_change, last_comment, last_mail, last_assignment, last_relation] if + x is not None] return max(args) except AttributeError: return None