-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent error when setting new default for multiple existing default dashboards #2680
Prevent error when setting new default for multiple existing default dashboards #2680
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a useful solution.
The tests were failing because you forgot to consider that dashboards are personal, so when there are multiple users, there will be multiple dashboard objects with the is_default
attribute set to True
.
(And there are always at least two users in a new NAV install, one representing the anonymous default
user, and one representing the admin
account)
I've pushed my suggested update to the tests...
Codecov Report
@@ Coverage Diff @@
## 5.7.x #2680 +/- ##
==========================================
+ Coverage 55.17% 55.19% +0.02%
==========================================
Files 561 561
Lines 40921 40917 -4
==========================================
+ Hits 22577 22584 +7
+ Misses 18344 18333 -11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
For some reason we ended up with multiple default dashboards This fix will make setting a new one possible
d8c372d
to
f5c0427
Compare
Kudos, SonarCloud Quality Gate passed! |
For some reason it happened that for multiple dashboards the
is_default
field is set to True, which leads to an error when trying to set a new dashboard as the default. This fixes that situation without doing anything about the underlying problem.