app/soc/modules/ghop/tasks/task_update.py
changeset 2871 e440e94a874b
parent 2867 e8d86272e6ea
child 2879 cb0f9b4646aa
equal deleted inserted replaced
2869:1ac6a1e1e429 2871:e440e94a874b
    21     '"Madhusudan.C.S" <madhusudancs@gmail.com>'
    21     '"Madhusudan.C.S" <madhusudancs@gmail.com>'
    22   ]
    22   ]
    23 
    23 
    24 
    24 
    25 import logging
    25 import logging
       
    26 import os
    26 
    27 
    27 from google.appengine.api.labs import taskqueue
    28 from google.appengine.api.labs import taskqueue
    28 from google.appengine.ext import db
    29 from google.appengine.ext import db
    29 
    30 
    30 from django import http
    31 from django import http
    31 from django.utils.translation import ugettext
    32 from django.utils.translation import ugettext
    32 
    33 
    33 from soc.logic import system
       
    34 from soc.tasks.helper import error_handler
    34 from soc.tasks.helper import error_handler
    35 from soc.views.helper import redirects
    35 from soc.views.helper import redirects
    36 
    36 
    37 from soc.modules.ghop.logic.models import task as ghop_task_logic
    37 from soc.modules.ghop.logic.models import task as ghop_task_logic
    38 
    38 
   178 
   178 
   179   subscribers = db.get(ts_entity.subscribers[
   179   subscribers = db.get(ts_entity.subscribers[
   180       subscriber_start_index:subscriber_start_index+batch_size])
   180       subscriber_start_index:subscriber_start_index+batch_size])
   181 
   181 
   182   task_url = "http://%(host)s%(task)s" % {
   182   task_url = "http://%(host)s%(task)s" % {
   183                  'host': system.getHostname(),
   183                  'host': os.environ['HTTP_HOST'],
   184                  'task': redirects.getPublicRedirect(
   184                  'task': redirects.getPublicRedirect(
   185                      task_entity, {'url_name': 'ghop/task'}),
   185                      task_entity, {'url_name': 'ghop/task'}),
   186                  }
   186                  }
   187 
   187 
   188   # create the data for the mail to be sent
   188   # create the data for the mail to be sent