Merge pull request #4740 from zh199225/develop
set a default value "/" for "Path" in the Cookie function when there is not parameter "Path" or the parameter is ""
This commit is contained in:
@@ -715,13 +715,6 @@ func (d *dbBase) Delete(ctx context.Context, q dbQuerier, mi *modelInfo, ind ref
|
||||
return 0, err
|
||||
}
|
||||
if num > 0 {
|
||||
if mi.fields.pk.auto {
|
||||
if mi.fields.pk.fieldType&IsPositiveIntegerField > 0 {
|
||||
ind.FieldByIndex(mi.fields.pk.fieldIndex).SetUint(0)
|
||||
} else {
|
||||
ind.FieldByIndex(mi.fields.pk.fieldIndex).SetInt(0)
|
||||
}
|
||||
}
|
||||
err := d.deleteRels(ctx, q, mi, args, tz)
|
||||
if err != nil {
|
||||
return num, err
|
||||
|
||||
@@ -2403,8 +2403,10 @@ func TestReadOrCreate(t *testing.T) {
|
||||
throwFail(t, AssertIs(nu.Status, u.Status))
|
||||
throwFail(t, AssertIs(nu.IsStaff, u.IsStaff))
|
||||
throwFail(t, AssertIs(nu.IsActive, u.IsActive))
|
||||
assert.True(t, u.ID > 0)
|
||||
|
||||
dORM.Delete(u)
|
||||
assert.True(t, u.ID > 0)
|
||||
}
|
||||
|
||||
func TestInLine(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user