mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-22 23:01:33 +01:00
Handle empty orlist in orm query (#11270)
Fixes #11267 When caller parse an empty orlist to orm lib, it will parse the empty vaule to beego orm. But beego will panic if the query string is empty. Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
e8ca51a18f
commit
da8902da53
@ -66,7 +66,7 @@ func QuerySetter(ctx context.Context, model interface{}, query *q.Query, ignored
|
||||
|
||||
// or list
|
||||
ol, ok := v.(*q.OrList)
|
||||
if ok {
|
||||
if ok && len(ol.Values) > 0 {
|
||||
qs = qs.Filter(k+"__in", ol.Values...)
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user