Skip to content

Commit

Permalink
some minor fix on block form (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
eikichi18 authored Sep 5, 2024
1 parent dc597a1 commit d88553a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
5.0.11 (unreleased)
-------------------

- Nothing changed yet.
- fixed translate on form block patch
- fixed check on saved value
[eikichi18]


5.0.10 (2024-09-04)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def reply(self):
message = translate(
_(
"save_data_exception",
default="Unable to save data. Value not unique: '${fields}'",
default="Impossibile salvare i dati. I campi '${fields}' non sono univoci.", # noqa
mapping={"fields": e.args[0]},
),
context=self.request,
Expand Down Expand Up @@ -225,7 +225,9 @@ def add(self, data):
for saved_record in saved_data:
unique = False
for key in keys:
if record.attrs.storage[key[0]] != saved_record.attrs.storage[key[0]]:
if record.attrs.storage[key[0]] != saved_record.attrs.storage.get(
key[0], None
):
unique = True
break

Expand Down
15 changes: 8 additions & 7 deletions src/design/plone/policy/tests/test_setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# -*- coding: utf-8 -*-
"""Setup tests for this package."""
import unittest

from design.plone.policy.testing import DESIGN_PLONE_POLICY_INTEGRATION_TESTING
from design.plone.policy.testing import (
DESIGN_PLONE_POLICY_INTEGRATION_TESTING,
DESIGN_PLONE_POLICY_LIMIT_ROOT_ADDABLES_INTEGRATION_TESTING,
)
from plone import api
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.registry.interfaces import IRegistry
from Products.CMFPlone.interfaces import ISearchSchema, ISiteSchema
from Products.CMFPlone.interfaces import ISearchSchema
from Products.CMFPlone.interfaces import ISiteSchema
from Products.CMFPlone.interfaces.controlpanel import INavigationSchema
from zope.component import getUtility

import unittest


try:
from Products.CMFPlone.utils import get_installer
except ImportError:
Expand Down Expand Up @@ -107,7 +110,6 @@ def test_browserlayer_removed(self):


class TestSetupLimitRootAddables(unittest.TestCase):

layer = DESIGN_PLONE_POLICY_LIMIT_ROOT_ADDABLES_INTEGRATION_TESTING

def setUp(self):
Expand All @@ -129,7 +131,6 @@ def test_setup(self):


class TestUninstallLimitRootAddables(unittest.TestCase):

layer = DESIGN_PLONE_POLICY_INTEGRATION_TESTING

def setUp(self):
Expand Down

0 comments on commit d88553a

Please sign in to comment.