You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
429 B

from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from hc.accounts.models import Profile
class Command(BaseCommand):
help = 'Make sure all users have profiles'
def handle(self, *args, **options):
for user in User.objects.all():
# this should create profile object if it does not exist
Profile.objects.for_user(user)
print("Done.")