Files
dss.api/spa/management/commands/debugUserProfile.py
Fergal Moran 6f9f29f5fc Initial commit
2015-04-30 23:17:58 +01:00

19 lines
625 B
Python
Executable File

from django.contrib.auth.models import User
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
try:
users = User.objects.all()
for user in users:
try:
if user.get_profile() is None:
print "Invalid user: %s" % user.username
except:
print "Invalid user: %s" % user.username
user.save()
pass
except Exception, ex:
print "Debug exception: %s" % ex.message