Explorar el Código

Fix to signed in user when user <-> org link is gone

Torkel Ödegaard hace 10 años
padre
commit
bf9e51928d
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      pkg/services/sqlstore/user.go

+ 5 - 0
pkg/services/sqlstore/user.go

@@ -283,6 +283,11 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error {
 		return m.ErrUserNotFound
 	}
 
+	if user.OrgRole == "" {
+		user.OrgId = -1
+		user.OrgName = "Org missing"
+	}
+
 	query.Result = &user
 	return err
 }