diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-11-09 17:15:02 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-11-09 17:15:02 +0000 |
commit | eceeda42cac9fd0063b8a6535addc7ed7f0099a6 (patch) | |
tree | fb8e140abcf4ac645a571f5e4c4d8a1b4a978358 /src/lib | |
parent | 7d01a029a358d6e8a0e8a16636b77282ce8f1b83 (diff) | |
download | bcfg2-eceeda42cac9fd0063b8a6535addc7ed7f0099a6.tar.gz bcfg2-eceeda42cac9fd0063b8a6535addc7ed7f0099a6.tar.bz2 bcfg2-eceeda42cac9fd0063b8a6535addc7ed7f0099a6.zip |
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 <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5561 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Reports/reports/templates/config_items/index.html | 24 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/views.py | 4 |
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: |