Unblock login after new discipline from config tool creation#7781
Unblock login after new discipline from config tool creation#7781acwhite211 wants to merge 1 commit intomainfrom
Conversation
alesan99
left a comment
There was a problem hiding this comment.
- See that you can login while the discipline and it's tree are still being created.
- Want sometime for all the background processes to end for creating the new collection, and the try logging in to the new collection.
Looks good! 👍
Logins work correctly and new collections appear after a while. I wasn't able to trigger the database setup loading page through the config tool, so that works.
| """Returns a dictionary of the status of the database setup.""" | ||
| # Check if setup is currently in progress | ||
| active_setup_task, busy = get_active_setup_task() | ||
| busy = busy or is_config_task_running() |
There was a problem hiding this comment.
@acwhite211 After trying the current behavior on main, I noticed that this PR doesn't wait for tree creation to finish before letting you log into the database during the initial database setup.
Should this be changed? I think there would some issues with the reliability of the tree loading messages before, which should be fixed now I think, so this might be okay. But it may be a problem for other background tasks.
bhumikaguptaa
left a comment
There was a problem hiding this comment.
Checking login after created a new discipline:
- See that you can login while the discipline and it's tree are still being created.
Checking login after creating a new collection:
- Confirm that the new collection is not yet available as an option of login as.
- Want sometime for all the background processes to end for creating the new collection, and the try logging in to the new collection.
Everything works as expected, I didn't run into any errors. I was able to view the new collection without logging out and back in.
Fixes #7774
Prevent a new discipline being created in the background from the user being able to login to a collection from an already existing discipline. Also, this solution needs to preserve the functionality of preventing the user from logging into a new collection before it is fully completed.
It seems this issue of new disciplines is being caused as a side-effect of the solution to preventing new collections from being used before they were fully ready.
While a new discipline was being created, background config Celery tasks were treated as global “setup in progress.” That made the login page show Guided Setup for users and could block login/collection switching even for unaffected collections.
The setup_progress busy variable now reflects only true initial database setup, not generic config tasks. Config-task blocking is collection aware, so only newly created collections are blocked, and existing collections and disciplines remain available.
Checklist
self-explanatory (or properly documented)
Testing instructions
Checking login after created a new discipline:
Checking login after creating a new collection: