diff --git a/hr/models.py b/hr/models.py index 42faf00..46e6b88 100644 --- a/hr/models.py +++ b/hr/models.py @@ -77,6 +77,12 @@ class Application(models.Model): return blacklist + @property + def last_action(self): + if self.audit_set.count(): + return self.audit_set.all().order_by('-date')[0] + return None + def save(self, *args, **kwargs): user = None diff --git a/templates/hr/applications/admin/view_list.html b/templates/hr/applications/admin/view_list.html index 8fa8f24..94afc07 100644 --- a/templates/hr/applications/admin/view_list.html +++ b/templates/hr/applications/admin/view_list.html @@ -15,12 +15,16 @@ Application ID Character Corporation - Application Status + Application Status + Last Action Date + Last Action User {% for app in apps %} {{ app.id }} {{ app.character }} {{ app.corporation }} {{ app.get_status_display }} + {{ app.last_action.date }} + {{ app.last_action.user }} {% endfor %}