Created
May 31, 2013 21:42
-
-
Save cooncesean/5688203 to your computer and use it in GitHub Desktop.
Update promo base urls from Turn to PurpleClover.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scout.promos.models import Stream | |
# CHANGE THESE AS NEEDED | |
DOMAIN_TO_REPLACE = 'http://www.purpleclover.com' | |
DOMAIN_TO_FIND = 'http://prod.turn.bermanbrauntech.com' | |
for name, _ in Stream.list_streams(): | |
stream = Stream.get_stream(name) | |
for promo in stream.get_promos(): | |
if promo: | |
promo['link'] = promo.get('link', '').replace(DOMAIN_TO_FIND, DOMAIN_TO_REPLACE) | |
promo.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment