Move sync_user_info management command from common to LMS.

This commit is contained in:
Nimisha Asthagiri
2016-10-06 15:58:39 -04:00
parent 4bb8810957
commit 8b0a26a419

View File

@@ -1,16 +0,0 @@
##
## One-off script to sync all user information to the discussion service (later info will be synced automatically)
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import lms.lib.comment_client as cc
class Command(BaseCommand):
help = 'Sync all user ids, usernames, and emails to the discussion service'
def handle(self, *args, **options):
for user in User.objects.all().iterator():
cc_user = cc.User.from_django_user(user)
cc_user.save()