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.
 
 
 
 
 

13 lines
376 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():
Profile.objects.get_or_create(user_id=user.id)
print("Done.")