Files
dss.api/spa/management/commands/add_user_uid.py
Fergal Moran 064b19affa Feed working
2016-07-06 00:11:39 +01:00

16 lines
431 B
Python
Executable File

import uuid
from django.core.management.base import NoArgsCommand
from spa.models import UserProfile
class Command(NoArgsCommand):
def handle_noargs(self, **options):
try:
users = UserProfile.objects.exclude(uid__isnull=False)
for user in users:
user.uid = uuid.uuid4()
user.save()
except Exception as ex:
print("Debug exception: %s" % ex)