carddef: don't match empty digests in get_data_source_items (#59542)
gitea-wip/wcs/pipeline/head Build started...
Details
gitea-wip/wcs/pipeline/head Build started...
Details
This commit is contained in:
parent
b8d8dc66ae
commit
179e426149
|
@ -541,6 +541,8 @@ def test_data_source_custom_view_digest(pub):
|
|||
logged_error = pub.loggederror_class.select()[1]
|
||||
assert logged_error.summary == 'Digest (custom view "view") not defined'
|
||||
assert logged_error.formdata_id == str(carddata2.id)
|
||||
assert CardDef.get_data_source_items('carddef:foo', get_by_text='') == []
|
||||
assert CardDef.get_data_source_items('carddef:foo:view', get_by_text='') == []
|
||||
|
||||
|
||||
def test_data_source_query_escape(pub):
|
||||
|
|
|
@ -230,7 +230,10 @@ class CardDef(FormDef):
|
|||
criterias.append(Equal('id_display', get_by_id))
|
||||
else:
|
||||
criterias.append(Equal('id', get_by_id))
|
||||
if get_by_text:
|
||||
if get_by_text is not None:
|
||||
if not get_by_text:
|
||||
# don't match empty digests
|
||||
return []
|
||||
criterias.append(ElementEqual('digests', digest_key, get_by_text))
|
||||
|
||||
items = [
|
||||
|
|
Loading…
Reference in New Issue