~widelands-dev/widelands-website/update_beautifulsoup4

« back to all changes in this revision

Viewing changes to pybb/management/commands/pybb_update_gravatar.py

  • Committer: Holger Rapp
  • Date: 2009-02-25 16:55:36 UTC
  • Revision ID: sirver@kallisto.local-20090225165536-3abfhjx8qsgtzyru
- Added my hacked version of pybb. Remerging new versions is very difficult at this point :(

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from optparse import make_option
 
2
 
 
3
from django.core.management.base import BaseCommand, CommandError
 
4
from django.contrib.auth.models import User
 
5
 
 
6
from pybb.gravatar import check_gravatar
 
7
 
 
8
class Command(BaseCommand):
 
9
    help = 'Fetch avatars from gravatar.com service for those users which did not set avatar'
 
10
 
 
11
    def handle(self, *args, **kwargs):
 
12
        for user in User.objects.all():
 
13
            print user.username
 
14
            old_avatar = user.pybb_profile.avatar
 
15
            if check_gravatar(user, ignore_date_joined=True):
 
16
                print ' + Found gravatar'