How to reset onboarding status of all users - TACC/Core-Portal GitHub Wiki

  1. Connect to portal_django (core_portal_django, if you are on local dev) docker exec -it portal_django /bin/bash
  2. attach to shell python3 shell
  3. run
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from portal.apps.onboarding.steps.system_access_v3 import SystemAccessStepV3

users = User.objects.all()
for u in users:
        u.profile.setup_complete = False
        setup_step = SystemAccessStepV3(u)
        setup_step.user.profile.setup_complete = False
    except ObjectDoesNotExist:
        print(f"Profile not found for user: {u.username}")