syncusermonitor.py 486 B

123456789101112
  1. from django.core.management.base import BaseCommand
  2. from django.utils import timezone
  3. from optparse import make_option
  4. from misago.monitor import Monitor
  5. from misago.models import User
  6. class Command(BaseCommand):
  7. help = 'Updates forum monitor to contain to date user information'
  8. def handle(self, *args, **options):
  9. User.objects.resync_monitor(Monitor())
  10. self.stdout.write('\nForum monitor has been updated to contain to date user information.\n')