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