From eceeda42cac9fd0063b8a6535addc7ed7f0099a6 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 9 Nov 2009 17:15:02 +0000 Subject: Reports: Fix interaction display (Patch from Tim Laszlo) [bugfix] From mailing list: This has bugged me for a while.. not sure where it broke but when clicking on an action on a node the details no longer display. Every entry displayed "This item does not currently exist on the host but is specified to exist in the configuration.". This is for the "/elements/bad/266499/" views. Also the clients affected list was no longer being displayed. I changed the look up for item here to throw a 404 if it wasnt found. Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5561 ce84e21b-d406-0410-9b95-82705330c041 --- .../reports/templates/config_items/index.html | 24 ++++++++++++++++------ src/lib/Server/Reports/reports/views.py | 4 ++-- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'src/lib/Server/Reports/reports') 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" %}
-

Bad {{item.kind}}: {{item.name}}

+

Bad {{item.entry.kind}}: {{item.entry.name}}

{% else %}
-

Modified {{item.kind}}: {{item.name}}

+

Modified {{item.entry.kind}}: {{item.entry.name}}

{% endifequal %}
@@ -58,11 +58,23 @@ Calendar {% ifequal mod_or_bad "modified" %} - - | + + | {% else %} - - | + + | {% endifequal %}


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: -- cgit v1.2.3-1-g7c22