Fix displaying 'Add a Provider' page on a fresh appliance #5783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1726721
The core of the problem is that, newly, new provider was added (Embedded Ansible) and it is preinstalled on MIQ by default, so after user (super admin) logs in, it behaves according to the code => Default dashboard is displayed, instead of expected 'Add a Provider' page, as it was in the past. So the code needs to be updated according to the new circumstance. However, there are more options to solve the situation. I decided to fix this in the same place where the problem takes shape. Feel free to add comments, ideas.
Before:
After:
Note:
I was able to reproduce the BZ locally. I've tested the fix with empty and non-empty DB, and it works.