summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Reports/reports/templates/config_items/index.html24
-rw-r--r--src/lib/Server/Reports/reports/views.py4
2 files changed, 20 insertions, 8 deletions
diff --git a/src/lib/Server/Reports/reports/templates/config_items/index.html b/src/lib/Server/Reports/reports/templates/config_items/index.html
index d9747904e..8de1a63cc 100644
--- a/src/lib/Server/Reports/reports/templates/config_items/index.html
+++ b/src/lib/Server/Reports/reports/templates/config_items/index.html
@@ -20,11 +20,11 @@
{% ifequal mod_or_bad "bad" %}
<div class="bad">
-<h2>Bad {{item.kind}}: {{item.name}}</h2>
+<h2>Bad {{item.entry.kind}}: {{item.entry.name}}</h2>
</div>
{% else %}
<div class="modified">
-<h2>Modified {{item.kind}}: {{item.name}}</h2>
+<h2>Modified {{item.entry.kind}}: {{item.entry.name}}</h2>
</div>
{% endifequal %}
<center>
@@ -58,11 +58,23 @@
<a href="" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;"
name="anchor1" ID="anchor1">Calendar</A>
{% ifequal mod_or_bad "modified" %}
- <input type="button" name="go" value="Go" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.id%}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" />
- | <input type="button" name="now" value="Now" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.id%}';"/>
+ <input type="button"
+ name="go"
+ value="Go"
+ onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.entry.id%}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" />
+ | <input type="button"
+ name="now"
+ value="Now"
+ onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.entry.id%}';"/>
{% else %}
- <input type="button" name="go" value="Go" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.id%}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" />
- | <input type="button" name="now" value="Now" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.id%}';"/>
+ <input type="button"
+ name="go"
+ value="Go"
+ onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.entry.id %}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;"/>
+ | <input type="button"
+ name="now"
+ value="Now"
+ onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.entry.id %}';"/>
{% endifequal %}
</form>
</span><br/><br/><br/></div>
diff --git a/src/lib/Server/Reports/reports/views.py b/src/lib/Server/Reports/reports/views.py
index e41836470..7a092c7d2 100644
--- a/src/lib/Server/Reports/reports/views.py
+++ b/src/lib/Server/Reports/reports/views.py
@@ -22,14 +22,14 @@ def config_item_modified(request, eyedee =None, timestamp = 'now', type=TYPE_MOD
else:
mod_or_bad = "bad"
- item = Entries_interactions.objects.get(id=eyedee).entry
+ item = get_object_or_404(Entries_interactions, id=eyedee)
#if everything is blank except current_exists, do something special
cursor = connection.cursor()
if timestamp == 'now':
cursor.execute("select client_id from reports_interaction, reports_entries_interactions, reports_client "+
"WHERE reports_client.current_interaction_id = reports_entries_interactions.interaction_id "+
"AND reports_entries_interactions.interaction_id = reports_interaction.id "+
- "AND reports_entries_interactions.entry_id = %s " +
+ "AND reports_entries_interactions.id = %s " +
"AND reports_entries_interactions.type = %s", [eyedee, type])
associated_client_list = Client.objects.active(timestamp).filter(id__in=[x[0] for x in cursor.fetchall()])
else: