mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Show the last action date and user on the application list
This commit is contained in:
@@ -77,6 +77,12 @@ class Application(models.Model):
|
|||||||
|
|
||||||
return blacklist
|
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):
|
def save(self, *args, **kwargs):
|
||||||
|
|
||||||
user = None
|
user = None
|
||||||
|
|||||||
@@ -15,12 +15,16 @@
|
|||||||
<tr><th><a href="{% url hr.views.admin_applications %}?o=id">Application ID</a></th>
|
<tr><th><a href="{% url hr.views.admin_applications %}?o=id">Application ID</a></th>
|
||||||
<th><a href="{% url hr.views.admin_applications %}?o=character">Character</a></th>
|
<th><a href="{% url hr.views.admin_applications %}?o=character">Character</a></th>
|
||||||
<th><a href="{% url hr.views.admin_applications %}?o=corporation">Corporation</a></th>
|
<th><a href="{% url hr.views.admin_applications %}?o=corporation">Corporation</a></th>
|
||||||
<th>Application Status</th></tr>
|
<th>Application Status</th>
|
||||||
|
<th>Last Action Date</th>
|
||||||
|
<th>Last Action User</th></tr>
|
||||||
{% for app in apps %}
|
{% for app in apps %}
|
||||||
<tr><td><a href="{% url hr.views.view_application app.id %}">{{ app.id }}</a></td>
|
<tr><td><a href="{% url hr.views.view_application app.id %}">{{ app.id }}</a></td>
|
||||||
<td>{{ app.character }}</td>
|
<td>{{ app.character }}</td>
|
||||||
<td>{{ app.corporation }}</td>
|
<td>{{ app.corporation }}</td>
|
||||||
<td>{{ app.get_status_display }}</td>
|
<td>{{ app.get_status_display }}</td>
|
||||||
|
<td>{{ app.last_action.date }}</td>
|
||||||
|
<td>{{ app.last_action.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user