moveusers.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from ... import avatars, bans, users
  2. from ..base import BaseCommand, CommandError
  3. class Command(BaseCommand):
  4. help = (
  5. "Moves users, avatars, followers, blocks "
  6. "and bans from Misago 0.5 installation"
  7. )
  8. def handle(self, *args, **options):
  9. self.stdout.write("Moving users from Misago 0.5:")
  10. self.start_timer()
  11. users.move_users(self.stdout, self.style)
  12. self.stdout.write(
  13. self.style.SUCCESS("Moved users in %s" % self.stop_timer()))
  14. self.start_timer()
  15. avatars.move_avatars(self.stdout, self.style)
  16. self.stdout.write(
  17. self.style.SUCCESS("Moved avatars in %s" % self.stop_timer()))
  18. self.start_timer()
  19. users.move_followers()
  20. self.stdout.write(
  21. self.style.SUCCESS("Moved followers in %s" % self.stop_timer()))
  22. self.start_timer()
  23. users.move_blocks()
  24. self.stdout.write(
  25. self.style.SUCCESS("Moved blocks in %s" % self.stop_timer()))
  26. self.start_timer()
  27. users.move_namehistory()
  28. self.stdout.write(
  29. self.style.SUCCESS("Moved name history in %s" % self.stop_timer()))
  30. self.start_timer()
  31. bans.move_bans()
  32. self.stdout.write(
  33. self.style.SUCCESS("Moved bans in %s" % self.stop_timer()))