mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Check for null disambiguation on validate (#5019)
This commit is contained in:
parent
af6841be49
commit
b7f938531b
2 changed files with 11 additions and 11 deletions
|
|
@ -102,11 +102,15 @@ func validateName(ctx context.Context, name string, disambig string, existingID
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modifier := models.CriterionModifierIsNull
|
||||||
|
|
||||||
if disambig != "" {
|
if disambig != "" {
|
||||||
performerFilter.Disambiguation = &models.StringCriterionInput{
|
modifier = models.CriterionModifierEquals
|
||||||
Value: disambig,
|
}
|
||||||
Modifier: models.CriterionModifierEquals,
|
|
||||||
}
|
performerFilter.Disambiguation = &models.StringCriterionInput{
|
||||||
|
Value: disambig,
|
||||||
|
Modifier: modifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
if existingID == nil {
|
if existingID == nil {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ func nameFilter(n string) *models.PerformerFilterType {
|
||||||
Value: n,
|
Value: n,
|
||||||
Modifier: models.CriterionModifierEquals,
|
Modifier: models.CriterionModifierEquals,
|
||||||
},
|
},
|
||||||
|
Disambiguation: &models.StringCriterionInput{
|
||||||
|
Modifier: models.CriterionModifierIsNull,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,13 +44,6 @@ func TestValidateName(t *testing.T) {
|
||||||
newName = "new name"
|
newName = "new name"
|
||||||
newDisambig = "new disambiguation"
|
newDisambig = "new disambiguation"
|
||||||
)
|
)
|
||||||
// existing1 := models.Performer{
|
|
||||||
// Name: name1,
|
|
||||||
// }
|
|
||||||
// existing2 := models.Performer{
|
|
||||||
// Name: name2,
|
|
||||||
// Disambiguation: disambig,
|
|
||||||
// }
|
|
||||||
|
|
||||||
pp := 1
|
pp := 1
|
||||||
findFilter := &models.FindFilterType{
|
findFilter := &models.FindFilterType{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue