Author: croberts
Date: 2011-04-20 22:01:21 +0000 (Wed, 20 Apr 2011)
New Revision: 4728
Modified:
trunk/cumin/python/cumin/grid/job.py
Log:
Another whack at fixing BZ
https://bugzilla.redhat.com/show_bug.cgi?id=696635 It was
decided to NOT show the edit button for completed jobs, so we have built some extra logic
into the render method for that button.
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2011-04-20 13:23:44 UTC (rev 4727)
+++ trunk/cumin/python/cumin/grid/job.py 2011-04-20 22:01:21 UTC (rev 4728)
@@ -576,7 +576,17 @@
def render_edit_button(self, session):
_, error = self.do_get_items(session)
- return not error and self.edit_button.render(session) or ""
+ render = True
+ #We check the JobStatus to see if the job is already completed.
+ #If it is, we do not want to show the "edit" button
+ for item in _:
+ if "property" in item:
+ if item["name"] == "JobStatus":
+ status = item["value"]
+ if JobStatusInfo.get_status_string(status) == "Completed":
+ render = False
+ break
+ return render and not error and self.edit_button.render(session) or ""
def render_title(self, session):
return "Attributes"