You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue with wildcards in calculations.
see error: "Wildcards for interims are not allowed:"
In the current code wildcards cannot be used without defining the keyword elsewhere in the function. You cannot use the "keyword.wildcard" by itself.
Reproduction guide
Create the analysis service "gs_Be7_00 " and calculation "send_object" and attempt to run it.
gs_Be7_00 is a keyword for the analysis service
Looking at the code:
keywords=re.compile(r"\[([^\.^\]]+)\]").findall(value)
forkeywordinkeywords:
# Check if the service keyword exists and is active.dep_service=catalog(getKeyword=keyword, is_active=True)
ifnotdep_serviceandkeywordnotininterim_keywords:
msg=_(
"Validation failed: Keyword '${keyword}' is invalid",
mapping={
'keyword': safe_unicode(keyword)
})
returnto_utf8(translate(msg))
# Allow to use Wildcards, LDL and UDL values in calculationsallowedwds= ["LDL", "UDL", "BELOWLDL", "ABOVEUDL"]
keysandwildcards=re.compile(r"\[([^\]]+)\]").findall(value)
keysandwildcards= [kforkinkeysandwildcardsif"."ink]
keysandwildcards= [k.split(".", 1) forkinkeysandwildcards]
errwilds= [k[1] forkinkeysandwildcardsifk[0] notinkeywords]
iflen(errwilds) >0:
msg=_(
"Wildcards for interims are not allowed: ${wildcards}",
mapping={
"wildcards": safe_unicode(", ".join(errwilds))
})
returnto_utf8(translate(msg))
The list "errwilds" will be filled if the key from keysandwildcards is not in keywords.
Expected behaviour
I would like to be able to use wildcards without passing the keyword separately.
Versions
OS: Linux
senaite.core: master
senaite.impress: master
senaite.core.listing: master
senaite.core.supermodel: master
The text was updated successfully, but these errors were encountered:
Description
Issue with wildcards in calculations.
see error: "Wildcards for interims are not allowed:"
In the current code wildcards cannot be used without defining the keyword elsewhere in the function. You cannot use the "keyword.wildcard" by itself.
Reproduction guide
Create the analysis service "gs_Be7_00 " and calculation "send_object" and attempt to run it.
gs_Be7_00 is a keyword for the analysis service
Looking at the code:
The list "errwilds" will be filled if the key from keysandwildcards is not in keywords.
Expected behaviour
I would like to be able to use wildcards without passing the keyword separately.
Versions
OS: Linux
senaite.core:
master
senaite.impress:
master
senaite.core.listing:
master
senaite.core.supermodel:
master
The text was updated successfully, but these errors were encountered: