Skip to content

Conversation

@Vlad0n20
Copy link
Contributor

@Vlad0n20 Vlad0n20 commented Oct 13, 2025

Purpose

Changes

process_manual_restart_approvals checks all manually restarted registrations and determines if
they're ready for approval

  • Celery Tasks:
    • check_manual_restart_approval - handles individual registrations
    • check_manual_restart_approvals_batch - processes multiple registrations
    • delayed_manual_restart_approval - schedules delayed checks

Added was_manually_restarted() function that checks if a registration was manually restarted within the last 48
hours
Modified archive_success() to automatically schedule an approval check 5 minutes after successful archival
This ensures manually restarted registrations get back into the approval pipeline
When an admin uses the "Force Archive" feature, it now logs this action in AdminLogEntry

old flow:

  1. Admins manually restart failed registrations
  2. The registration archives successfully
  3. But it never enters the auto-approval queue because it missed the original workflow
  4. The registration sits in "pending approval" state indefinitely
  5. Requires manual intervention to approve each one

new one:

  1. System tracks when admins manually restart registrations (audit log)
  2. Upon successful archival, automatically schedules approval check
  3. Management command verifies the registration meets all approval criteria
  4. Automatically approves if past 48-hour window and all checks pass
  5. Closes the gap in the approval workflow

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8515?atlOrigin=eyJpIjoiZjdmOTIyZTYxOGIxNDAzNjhhZmY5ZjliYzQzMjg4MzciLCJwIjoiaiJ9

@adlius adlius deleted the branch CenterForOpenScience:feature/pbs-25-21 October 16, 2025 13:17
@adlius adlius closed this Oct 16, 2025
@adlius adlius reopened this Oct 22, 2025
@adlius adlius changed the base branch from feature/pbs-25-19 to feature/pbs-25-21 October 22, 2025 14:48
@adlius
Copy link
Collaborator

adlius commented Oct 22, 2025

@Vlad0n20 Could you rebase this onto the latest feature/pbs-25-21 branch?

@Vlad0n20
Copy link
Contributor Author

@Vlad0n20 Could you rebase this onto the latest feature/pbs-25-21 branch?
@adlius Done

@adlius
Copy link
Collaborator

adlius commented Oct 23, 2025

@Vlad0n20 There is a merge conflict. Also, could you update the PR description to include a bit more info for the fix (e.g. the purpose of the two management commands) so that reviewers have a better idea about the fix? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants