Created
June 1, 2012 08:45
-
-
Save meehow/2850421 to your computer and use it in GitHub Desktop.
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
from django.core.management.base import BaseCommand | |
from django.contrib.auth.models import User | |
from profiles.models import UserProfile | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
for user in User.objects.all(): | |
try: | |
profile = user.get_profile() | |
except UserProfile.DoesNotExist: | |
print user | |
UserProfile.objects.create(user=user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment