def deliver_product(user, product_id): try: product = COIN_PRODUCTS[product_id] economy.credit(user, product['amount']) except KeyError: product = BRUSH_PRODUCTS[product_id] Brush.objects.get(iap_product_id=product_id).unlock_for_user(user)
def handle(self, *args, **options): for comment_id in preloaded_explore_comment_ids(): comment = QuestComment.objects.get(id=comment_id) author = comment.author print author.username Actions.featured_in_explore(author, comment, defer=False) economy.credit(author, knobs.REWARDS['featured_in_explore'])
def staff_gift_coins(request, username, amount): amount = int(amount) if amount > 400: raise ServiceError("Can't gift more than 400 at a time (sanity check).") user = get_object_or_404(User, username=username) economy.credit(user, amount)
def staff_gift_coins(request, username, amount): amount = int(amount) if amount > 400: raise ServiceError( "Can't gift more than 400 at a time (sanity check).") user = get_object_or_404(User, username=username) economy.credit(user, amount)
def deliver_product(user, product_id): product = COIN_PRODUCTS[product_id] economy.credit(user, product["amount"])
def deliver_product(user, product_id): product = COIN_PRODUCTS[product_id] economy.credit(user, product['amount'])