diff --git a/server/core/management/commands/reset_all_passwords.py b/server/core/management/commands/reset_all_passwords.py new file mode 100644 index 00000000..886a9266 --- /dev/null +++ b/server/core/management/commands/reset_all_passwords.py @@ -0,0 +1,17 @@ +from django.contrib.auth import get_user_model +from django.core.management import BaseCommand + + +class Command(BaseCommand): + def handle(self, *args, **options): + self.stdout.write("Caution:") + self.stdout.write("Do you really want to reset **ALL** passwords") + self.stdout.write("If so, type \"YES\"") + + result = input() + + if result == 'YES': + users = get_user_model().objects.all() + for user in users: + user.set_password('test') + user.save()