| Line 36... |
Line 36... |
| 36 |
eligibleSmsNotficationCampaigns = notification_campaigns.query.filter(notification_campaigns.sendsms==True).filter(notification_campaigns.smsprocessed==False).filter(notification_campaigns.created<timeCondition).filter(notification_campaigns.expiresat>expireTimeCondition).all()
|
36 |
eligibleSmsNotficationCampaigns = notification_campaigns.query.filter(notification_campaigns.sendsms==True).filter(notification_campaigns.smsprocessed==False).filter(notification_campaigns.created<timeCondition).filter(notification_campaigns.expiresat>expireTimeCondition).all()
|
| 37 |
#eligibleSmsNotficationCampaigns = notification_campaigns.query.filter(notification_campaigns.id==5417).all()
|
37 |
#eligibleSmsNotficationCampaigns = notification_campaigns.query.filter(notification_campaigns.id==5417).all()
|
| 38 |
|
38 |
|
| 39 |
for notificationCampaign in eligibleSmsNotficationCampaigns:
|
39 |
for notificationCampaign in eligibleSmsNotficationCampaigns:
|
| 40 |
logging.debug('Notification_Campign_Id:- '+str(notificationCampaign.id))
|
40 |
logging.debug('Notification_Campign_Id:- '+str(notificationCampaign.id))
|
| - |
|
41 |
notificationCampaign.smsprocessed = True
|
| - |
|
42 |
session.commit()
|
| 41 |
sentFailedresponse = urllib2.urlopen(PUSH_NOTIFICATIONS_DETAILS_URL%('sent',notificationCampaign.id,0)).read()
|
43 |
sentFailedresponse = urllib2.urlopen(PUSH_NOTIFICATIONS_DETAILS_URL%('sent',notificationCampaign.id,0)).read()
|
| 42 |
jsonList = json.loads(sentFailedresponse)
|
44 |
jsonList = json.loads(sentFailedresponse)
|
| 43 |
userList = []
|
45 |
userList = []
|
| 44 |
for obj in jsonList:
|
46 |
for obj in jsonList:
|
| 45 |
userList.append(long(obj.get('user_id')))
|
47 |
userList.append(long(obj.get('user_id')))
|