Created
May 13, 2016 13:22
-
-
Save clintonb/89845ee8afa0cad2791f7b29926a44c9 to your computer and use it in GitHub Desktop.
Create profiles for edx-platform service users
This file contains hidden or 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
""" Create profiles for service users. """ | |
from django.contrib.auth import get_user_model | |
from student.models import UserProfile | |
User = get_user_model() | |
usernames = ('affiliate_window', 'course_discovery_worker', 'programs_worker', 'sailthru',) | |
for username in usernames: | |
user = User.objects.get(username=username) | |
profile, created = UserProfile.objects.get_or_create(user=user) | |
if created: | |
print 'Created profile for {username}'.format(username=username) | |
else: | |
print 'Profile already exists for {username}'.format(username=username) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment