refactor(setup): update preference retrieval to user-scope only
- Modified the handleSetupStatus function to read user-specific preferences instead of merged settings, ensuring that personal preferences do not inherit from system or team scopes. - This change enhances the accuracy of user preference handling in the setup status process.
This commit is contained in:
parent
01daa783e0
commit
d6626b2a7e
1 changed files with 3 additions and 1 deletions
|
|
@ -45,7 +45,9 @@ func handleSetupStatus(c *gin.Context) {
|
||||||
bannerDismissed := false
|
bannerDismissed := false
|
||||||
onboardingCompleted := false
|
onboardingCompleted := false
|
||||||
if setting.Global != nil {
|
if setting.Global != nil {
|
||||||
prefs, _ := setting.Global.GetMerged(info.UserID, info.TeamID, preferenceNS)
|
// Read user-scope only: these are personal preferences that must not
|
||||||
|
// inherit from system/team scopes.
|
||||||
|
prefs, _ := setting.Global.Get(preferenceScope(info), preferenceNS)
|
||||||
if prefs != nil {
|
if prefs != nil {
|
||||||
if v, ok := prefs["banner_dismissed"].(bool); ok {
|
if v, ok := prefs["banner_dismissed"].(bool); ok {
|
||||||
bannerDismissed = v
|
bannerDismissed = v
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue