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

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