Skip to content

Commit

Permalink
Add incident id in artifact correlation view if INCIDENT_SHOW_ID is True
Browse files Browse the repository at this point in the history
gcrahay committed Jan 5, 2017
1 parent 8e82473 commit 84ec165
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fir_artifacts/views.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.shortcuts import get_object_or_404, render, redirect
from django.conf import settings
from fir_artifacts.files import do_download_archive, do_download, do_upload_file, do_remove_file

from incidents.views import is_incident_viewer
@@ -14,7 +15,9 @@
def artifacts_correlations(request, artifact_id):
a = get_object_or_404(Artifact, pk=artifact_id)
correlations = a.relations.group()
return render(request, 'fir_artifacts/correlation_list.html', {'correlations': correlations, 'artifact': a})
return render(request, 'fir_artifacts/correlation_list.html', {'correlations': correlations,
'artifact': a,
'incident_show_id': settings.INCIDENT_SHOW_ID})


@login_required
3 changes: 3 additions & 0 deletions incidents/templates/incidents/plugins/correlation_list.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n %}
{% load fir_plugins %}
{% load authorization %}
{% block content %}
{% with incident_list=correlations.incidents.objects %}
@@ -8,6 +9,7 @@ <h3>{% trans "Incidents" %}</h3>

<thead>
<tr>
{% if incident_show_id %}<th>ID</th>{% endif %}
<th>{% trans "Date" %}</th>
<th>{% trans "Subject" %}</th>
<th>{% trans "Category" %}</th>
@@ -25,6 +27,7 @@ <h3>{% trans "Incidents" %}</h3>
{% has_perm 'incidents.handle_incidents' obj=incident as can_handle_incident %}
{% if can_view_incident %}
<tr>
{% if incident_show_id %}<td>{{ incident|object_id }}</td>{% endif %}
<td>{{ incident.date|date:"SHORT_DATE_FORMAT" }}</td>
<td><a href="{% url 'incidents:details' incident.id %}">{{ incident.subject }}</a></td>
<td>{{ incident.category }}</td>

0 comments on commit 84ec165

Please sign in to comment.