SHARE
TWEET

Untitled

a guest May 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tornado.ioloop import IOLoop
  2.  
  3. from api import db
  4. from api.users.user_purchases.actions.driver import queue_message_for_action
  5. from api.users.user_purchases.actions.constants import UserPurchaseActions
  6.  
  7. USER_PURCHASE_IDS = [
  8.     # Add purchase IDs with unsent emails here.
  9. ]
  10.  
  11. if __name__ == '__main__':
  12.     session = db.Session()
  13.     total = len(USER_PURCHASE_IDS)
  14.  
  15.     # Generate report
  16.     for i, user_purchase_id in enumerate(USER_PURCHASE_IDS):
  17.         IOLoop.current().run_sync(
  18.             lambda: queue_message_for_action(session, user_purchase_id, UserPurchaseActions.NOTIFY_FULFILLED_EMAIL)
  19.         )
  20.         print('[{}/{}] queued message for user_purchase {}'.format(i, total, user_purchase_id))
  21.  
  22.     print('Done')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top