Skip to content

Commit

Permalink
fix fallback to normal default value
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Oct 26, 2023
1 parent c9befad commit 413ce6c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/jazkarta/easyformplugin/salesforce/prefill.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collective.easyform.api import get_actions
from collective.easyform.interfaces import IEasyForm
from collective.easyform.interfaces import IEasyFormForm
from collective.easyform.fields import superAdapter
from dateutil.parser import parse
from simple_salesforce import Salesforce
from z3c.form.interfaces import IValue
Expand Down Expand Up @@ -37,9 +38,15 @@ def prefill_value_factory(context, request, view, field, widget):
if expr == "form:%s" % field.__name__:
return SalesforcePrefillValue(form, field, operation, sf_field)

# Didn't find one, so return None
# so that the IValue adapter lookup continues to the next one
return None
# Didn't find one, fall back to less specific adapter
adapter = superAdapter(
IJazkartaEasyformpluginSalesforceLayer,
prefill_value_factory,
(context, request, view, field, widget),
name="default",
)
if adapter is not None:
return adapter


@implementer(IValue)
Expand Down

0 comments on commit 413ce6c

Please sign in to comment.