123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- # -*- coding: utf-8 -*-
- # !/usr/bin/env python
- """
- 默认所有经销商支持线下投币的特性
- """
- import os
- import sys
- #: current_dir - 2
- PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
- sys.path.insert(0, PROJECT_ROOT)
- from script.base import init_env, get_logger
- logger = get_logger(__name__)
- init_env(interactive=True)
- from apps.web.dealer.models import Dealer
- from apps.web.common.models import Feature
- if not Feature.objects(name = "show_offline_coins"):
- offline_coin_feature = Feature(**{
- "name": "show_offline_coins",
- "role": "dealer",
- "managerId": "59974b4b8732d6480fb699e5",
- "by": "5b5165d9c9a6bd1bec34fa6d",
- "description": u"是否显示线下投币模块",
- }).save()
- if not Feature.objects(name = "manual_withdraw"):
- manual_withdraw_feature = Feature(**{
- "name": "manual_withdraw",
- "role": "agent",
- "managerId": "59974b4b8732d6480fb699e5",
- "by": "5b5165d9c9a6bd1bec34fa6d",
- "description": u"是否手动提现",
- }).save()
- result = Dealer.get_collection().update({}, { '$addToSet': {'features': "show_offline_coins"}}, multi=True)
- logger.info('finished, result=%s' % (result,))
|