mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-31 05:39:02 +00:00
19 lines
625 B
Python
Executable File
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 |