Files
kolaente 1f79a8e01a fix(migration): reject repeated csv column mappings, cap labels per row
- Reject a config that maps a column more than once, already when the
  import is started or previewed.
- Import repeated labels of a row once and reject rows with more than
  MaxLabelsPerTask (100) labels.
- Count items while converting rows so a file over the import item limit
  fails before the whole structure is built.
- Walk mappings sorted by column so a row only visits the cells it has.
2026-11-05 15:42:45 +01:00

34 lines
1.2 KiB
Go

// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-present Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package models
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
)
func TestErrInvalidFilterExpressionHTTPErrorOmitsExpression(t *testing.T) {
err := ErrInvalidFilterExpression{Expression: "secret-filter", ExpressionError: errors.New("boom")}
httpErr := err.HTTPError()
assert.NotContains(t, httpErr.Message, "secret-filter")
assert.Contains(t, httpErr.Message, "boom")
assert.Contains(t, err.Error(), "secret-filter")
}