[Zope-CVS] CVS: Packages/JobBoardEx/Views/Browser - ApproveJobs.py:1.3

Barry Warsaw barry@wooz.org
Wed, 20 Mar 2002 17:24:21 -0500


Update of /cvs-repository/Packages/JobBoardEx/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv816/Views/Browser

Modified Files:
	ApproveJobs.py 
Log Message:
cancel(): Fix the redirect to ..

submit(): Fix the argument to joblist.query() and get the id directly
out of the job object via attribute access, not method call.


=== Packages/JobBoardEx/Views/Browser/ApproveJobs.py 1.2 => 1.3 ===
 from Zope.ComponentArchitecture.ContextDependent import ContextDependent
 
+from ZopeProducts.JobBoardEx.IJob import JobState
 
 class ApproveJobs(AttributePublisher, ContextDependent):
     index = PageTemplateFile('ApproveJobs.pt')
 
     def cancel(self, REQUEST):
-        # XXX This redirect will change
-        return REQUEST.RESPONSE.redirect('Hello.pt')
+        return REQUEST.response.redirect('..')
+
+    back = cancel
 
     def submit(self, REQUEST):
         """Approve a job."""
         joblist = self.getContext()
-        for job in joblist.query('waiting'):
-            jobid = 'job_%s' % job.getId()
+        for job in joblist.query(JobState.PendingApproval):
+            jobid = 'job_%s' % job.id
             value = REQUEST.get(jobid, None)
             if value == 'defer':
                 pass