upgrade_OnSale_20190111.py 647 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. """
  4. """
  5. import os
  6. import sys
  7. #: current_dir - 2
  8. PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
  9. sys.path.insert(0, PROJECT_ROOT)
  10. from script.base import init_env, get_logger
  11. logger = get_logger(__name__)
  12. init_env(interactive=True)
  13. from apps.web.dealer.models import OnSale
  14. done0 = OnSale.objects(onClickUrl="/user/startDuration").update(onClickUrl='/user/promotion/getDuration')
  15. done1 = OnSale.objects(onClickUrl="/user/sendCoins").update(onClickUrl='/user/promotion/getCoins')
  16. assert all([done0, done1])
  17. logger.info('finished')