stash
This commit is contained in:
parent
dc0b0f818e
commit
9b6c2ab5a3
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue