Commit 09baabee by Rocky Duan

added command: run rake django-admin[sync_user_info] to sync info to discussion

parent 0af26ae8
##
## 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 comment_client
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():
comment_client.update_user(user.id, {
'id': user.id,
'username': user.username,
'email': user.email
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment