Commit 9e1ec652 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Ensure you are comparing integers when get value from preference

Also define a short cache, to prevent creation explosion
parent f904129e
...@@ -14,8 +14,9 @@ def isSupportRequestCreationClosed(destination_decision=None): ...@@ -14,8 +14,9 @@ def isSupportRequestCreationClosed(destination_decision=None):
destination_decision).getUid() destination_decision).getUid()
support_request_amount = context.portal_catalog.countResults(**kw)[0][0] support_request_amount = context.portal_catalog.countResults(**kw)[0][0]
return support_request_amount >= limit return support_request_amount >= int(limit)
return CachingMethod(isSupportRequestCreationClosed, return CachingMethod(isSupportRequestCreationClosed,
"isSupportRequestCreationClosed")(destination_decision=destination_decision) "isSupportRequestCreationClosed",
cache_factory="erp5_content_short")(destination_decision=destination_decision)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment