Remove testing method and update docstring for cron system
Patch by: Sverre Rabbelier
--- a/app/soc/cron/job.py Sat Apr 18 14:04:39 2009 +0000
+++ b/app/soc/cron/job.py Sat Apr 18 14:25:30 2009 +0000
@@ -110,6 +110,8 @@
def handle(self, job_key):
"""Handle one job.
+
+ Returns: whether another job should be started after this one
"""
try:
--- a/app/soc/views/models/cron.py Sat Apr 18 14:04:39 2009 +0000
+++ b/app/soc/views/models/cron.py Sat Apr 18 14:25:30 2009 +0000
@@ -64,21 +64,13 @@
super(View, self).__init__(params=params)
- def add(self, request, access_type, page_name):
- group = priority_group_logic.getGroup(priority_group_logic.EMAIL)
+ def poke(self, request, access_type, page_name):
+ """View called by the cron system that handles jobs.
- fields = {
- 'priority_group': group,
- 'task_name': 'sendAcceptanceEmail',
- 'text_data': "O HI THAR",
- }
-
- job_logic.updateOrCreateFromFields(fields)
-
- return http.HttpResponse("Done")
-
- def poke(self, request, access_type, page_name):
- """
+ Args:
+ request: the standard Django HTTP request object
+ access_type : the name of the access type which should be checked
+ page_name: the page name displayed in templates as page and header title
"""
order = ['-priority']
@@ -117,5 +109,4 @@
view = View()
-add = view.add
poke = view.poke