[ENG-8515] - Add management command to manual archive
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:
- Admins manually restart failed registrations
- The registration archives successfully
- But it never enters the auto-approval queue because it missed the original workflow
- The registration sits in "pending approval" state indefinitely
- Requires manual intervention to approve each one
new one:
- System tracks when admins manually restart registrations (audit log)
- Upon successful archival, automatically schedules approval check
- Management command verifies the registration meets all approval criteria
- Automatically approves if past 48-hour window and all checks pass
- 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
@Vlad0n20 Could you rebase this onto the latest feature/pbs-25-21 branch?
@Vlad0n20 Could you rebase this onto the latest
feature/pbs-25-21branch? @adlius Done
@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.