Skip to content

Unblock login after new discipline from config tool creation#7781

Open
acwhite211 wants to merge 1 commit intomainfrom
issue-7774-2
Open

Unblock login after new discipline from config tool creation#7781
acwhite211 wants to merge 1 commit intomainfrom
issue-7774-2

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Mar 3, 2026

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-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

Checking login after created a new discipline:

  • Open the configuration tool page.
  • In a separate private browser window, open up the login page, type in the login username and password, but don't login yet.
  • In the configuration tool, go through the process of creating a new discipline. Make sure to configure a new tree to be uploaded for the new discipline. Before finsihing the discipline creation, be ready to quickly switch to the login page.
  • As soon as you press "Save" for the new discipline in the login page, quickly switch to the login page in your separate private window login any of the existing collections.
  • See that you can login while the discipline and it's tree are still being created.

Checking login after creating a new collection:

  • In the private browser window, logout, and set it up so you can quickly log back in later.
  • In the other browser window, use the configuration tool to create a new collection.
  • After pressing "Save" to create the new collection, quickly switch over to the private browser window to try logging in.
  • 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.

@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Mar 3, 2026
@acwhite211 acwhite211 added this to the 7.12.0 milestone Mar 3, 2026
@acwhite211 acwhite211 self-assigned this Mar 3, 2026
@acwhite211 acwhite211 requested review from a team, alesan99 and grantfitzsimmons March 3, 2026 20:28
@acwhite211 acwhite211 marked this pull request as ready for review March 3, 2026 20:28
@acwhite211 acwhite211 changed the title Unblock login after new discipline from config creation Unblock login after new discipline from config tool creation Mar 3, 2026
Copy link
Contributor

@alesan99 alesan99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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()
Copy link
Contributor

@alesan99 alesan99 Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acwhite211, yes this needs to be changed

Copy link
Collaborator

@bhumikaguptaa bhumikaguptaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Can't log into a database if a discipline is being created

4 participants