app/soc/tasks/helper/decorators.py
changeset 2993 e412510746dc
parent 2991 d6efef2989ac
child 2995 5931e6d6056f
--- a/app/soc/tasks/helper/decorators.py	Tue Sep 29 20:10:08 2009 +0200
+++ b/app/soc/tasks/helper/decorators.py	Tue Sep 29 20:11:54 2009 +0200
@@ -93,7 +93,7 @@
     if 'json' in post_dict:
       json = post_dict['json']
 
-    entities, start_key = logic.getBatchOfData(filter, order, start_key)
+    entities, next_start_key = logic.getBatchOfData(filter, order, start_key)
 
     try:
       new_json = func(request, entities=entities, json=json, *args, **kwargs)
@@ -104,15 +104,13 @@
       logging.error(exception)
       return task_responses.repeatTask()
 
-    if start_key is None:
-      logging.debug('Task sucessfully completed')
-    else:
+    if next_start_key:
       context = post_dict.copy()
 
       if 'json' in context:
         del context['json']
 
-      context.update({'start_key': start_key})
+      context.update({'start_key': next_start_key})
 
       if new_json is not None:
         context.update({'json': new_json})