Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Changelog
[chris-adam]
- Considered seal when checking if a signer is defined on a sub/template.
[sgeulette]
- Updated robotframework tests to include electronic signature (PARAF-166).
[chris-adam]
- Fixed ``ConnectionStateError`` crash when rendering datagrid fields
in settings through robotframework tests (DMS-434).
[chris-adam]

3.1.5 (2026-06-19)
------------------
Expand Down
26 changes: 26 additions & 0 deletions imio/dms/mail/browser/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
# from z3c.form.browser.radio import RadioFieldWidget
# from z3c.form.interfaces import WidgetActionExecutionError
from z3c.form.validator import NoInputData
from ZODB.POSException import ConnectionStateError
from zope import schema
from zope.component import getUtility
from zope.globalrequest import getRequest
Expand Down Expand Up @@ -1245,7 +1246,32 @@ class SettingsEditForm(RegistryEditForm):
form.extends(RegistryEditForm)
schema = IImioDmsMailConfig

_datagrid_row_schemas = {
"mail_types": ITableListSchema,
"imail_fields": IIMFieldsSchema,
"imail_send_modes": ITableListSchema,
"iemail_routing": IRoutingSchema,
"iemail_state_set": IStateSetSchema,
"omail_types": ITableListSchema,
"omail_send_modes": ITableListSchema,
"omail_signer_substitutes": ISignerSubstituteSchema,
"omail_signer_rules": ISignerRuleSchema,
"omail_fields": IOMFieldsSchema,
}

def _heal_datagrid_value_types(self):
for name, row_schema in self._datagrid_row_schemas.items():
field = self.schema.get(name)
if field is None or getattr(field, "value_type", None) is None:
continue
try:
field.value_type.schema
except ConnectionStateError:
logger.warn("DMS-434: rebuilding stale datagrid value_type for %r", name)
field.value_type = DictRow(title=field.title, schema=row_schema, required=False)

def update(self):
self._heal_datagrid_value_types()
super(SettingsEditForm, self).update()
# !! groups are updated outside and after updateWidgets
# we will display unconfigured fields
Expand Down
Loading