-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/2.6.x Date: 2022-08-27T08:49:07+02:00 Author: ale-rt (ale-rt) <[email protected]> Commit: plone/plone.app.users@bee9152 Added a timezone setter Add a timezone setter that prevents `None` to be stored as a timezone. Save it as an empty string instead. Backports #110 to the 2.6 branch to support Plone 5.2 Files changed: A news/109.bugfix M plone/app/users/browser/account.py Repository: plone.app.users Branch: refs/heads/2.6.x Date: 2022-08-29T10:37:02+02:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.app.users@2e63ec3 Merge pull request #111 from plone/109-backport Add a timezone setter Files changed: A news/109.bugfix M plone/app/users/browser/account.py
- Loading branch information
Showing
1 changed file
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
Repository: plone.app.upgrade | ||
Repository: plone.app.users | ||
|
||
|
||
Branch: refs/heads/2.x | ||
Date: 2022-08-27T12:15:42+02:00 | ||
Branch: refs/heads/2.6.x | ||
Date: 2022-08-27T08:49:07+02:00 | ||
Author: ale-rt (ale-rt) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.upgrade/commit/85c96b354599e9ea273ee55ab0355127fda3c2cd | ||
Commit: https://github.com/plone/plone.app.users/commit/bee91521783a862969e4a6421d855da1aa2e6567 | ||
|
||
Add a timezone property to portal memberdata if it is missing | ||
Added a timezone setter | ||
|
||
Backports #296 to Plone 5.2 | ||
Add a timezone setter that prevents `None` to be stored as a timezone. | ||
Save it as an empty string instead. | ||
|
||
Backports #110 to the 2.6 branch to support Plone 5.2 | ||
|
||
Files changed: | ||
A news/296.fixed | ||
M plone/app/upgrade/v52/configure.zcml | ||
M plone/app/upgrade/v52/final.py | ||
A news/109.bugfix | ||
M plone/app/users/browser/account.py | ||
|
||
b'diff --git a/news/296.fixed b/news/296.fixed\nnew file mode 100644\nindex 00000000..b1123ddf\n--- /dev/null\n+++ b/news/296.fixed\n@@ -0,0 +1,3 @@\n+Add a timezone property to portal memberdata if it is missing\n+ \n+Backports #296 to Plone 5.2\ndiff --git a/plone/app/upgrade/v52/configure.zcml b/plone/app/upgrade/v52/configure.zcml\nindex dd44d942..9f689905 100644\n--- a/plone/app/upgrade/v52/configure.zcml\n+++ b/plone/app/upgrade/v52/configure.zcml\n@@ -265,8 +265,8 @@\n profile="Products.CMFPlone:plone">\n \n <gs:upgradeStep\n- title="Miscellaneous upgrades to Plone 5.2.10"\n- handler="..utils.null_upgrade_step"\n+ title="Add a timezone property to portal memberdata if it is missing."\n+ handler=".final.add_the_timezone_property"\n />\n \n </gs:upgradeSteps>\ndiff --git a/plone/app/upgrade/v52/final.py b/plone/app/upgrade/v52/final.py\nindex 78aa1b58..c49cd866 100644\n--- a/plone/app/upgrade/v52/final.py\n+++ b/plone/app/upgrade/v52/final.py\n@@ -267,3 +267,11 @@ def secure_portal_setup_objects(context):\n return\n _recursive_strict_permission(context.snapshots)\n logger.info("Made portal_setup snapshots only available for Manager and Owner.")\n+\n+\n+def add_the_timezone_property(context):\n+ """Ensure that the portal_memberdata tool has the timezone property."""\n+ portal_memberdata = getToolByName(context, "portal_memberdata")\n+ if portal_memberdata.hasProperty("timezone"):\n+ return\n+ portal_memberdata.manage_addProperty("timezone", "", "string")\n' | ||
b"diff --git a/news/109.bugfix b/news/109.bugfix\nnew file mode 100644\nindex 00000000..a7f6796f\n--- /dev/null\n+++ b/news/109.bugfix\n@@ -0,0 +1 @@\n+Ensure that, when no timezone is selected, the value of the stored timezone is an empty string\ndiff --git a/plone/app/users/browser/account.py b/plone/app/users/browser/account.py\nindex 91c0e6c1..b6242ece 100644\n--- a/plone/app/users/browser/account.py\n+++ b/plone/app/users/browser/account.py\n@@ -138,6 +138,16 @@ def wysiwyg_editor(self, value):\n value = ''\n return self._setProperty('wysiwyg_editor', value)\n \n+ @property\n+ def timezone(self):\n+ return self._getProperty('timezone')\n+\n+ @timezone.setter\n+ def timezone(self, value):\n+ if value is None:\n+ value = ''\n+ return self._setProperty('timezone', value)\n+\n \n @implementer(IAccountPanelForm)\n class AccountPanelForm(AutoExtensibleForm, form.Form):\n" | ||
|
||
Repository: plone.app.upgrade | ||
Repository: plone.app.users | ||
|
||
|
||
Branch: refs/heads/2.x | ||
Date: 2022-08-29T10:35:15+02:00 | ||
Branch: refs/heads/2.6.x | ||
Date: 2022-08-29T10:37:02+02:00 | ||
Author: Jens W. Klein (jensens) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.upgrade/commit/e5fffabf0a351c0d8f4670be2f605bb6c9c9df4a | ||
Commit: https://github.com/plone/plone.app.users/commit/2e63ec3aa7b4ff51641e4f108db521872cd9de77 | ||
|
||
Merge pull request #297 from plone/296-backport | ||
Merge pull request #111 from plone/109-backport | ||
|
||
[5.2] Add a timezone property to portal memberdata if it is missing | ||
Add a timezone setter | ||
|
||
Files changed: | ||
A news/296.fixed | ||
M plone/app/upgrade/v52/configure.zcml | ||
M plone/app/upgrade/v52/final.py | ||
A news/109.bugfix | ||
M plone/app/users/browser/account.py | ||
|
||
b'diff --git a/news/296.fixed b/news/296.fixed\nnew file mode 100644\nindex 00000000..b1123ddf\n--- /dev/null\n+++ b/news/296.fixed\n@@ -0,0 +1,3 @@\n+Add a timezone property to portal memberdata if it is missing\n+ \n+Backports #296 to Plone 5.2\ndiff --git a/plone/app/upgrade/v52/configure.zcml b/plone/app/upgrade/v52/configure.zcml\nindex dd44d942..9f689905 100644\n--- a/plone/app/upgrade/v52/configure.zcml\n+++ b/plone/app/upgrade/v52/configure.zcml\n@@ -265,8 +265,8 @@\n profile="Products.CMFPlone:plone">\n \n <gs:upgradeStep\n- title="Miscellaneous upgrades to Plone 5.2.10"\n- handler="..utils.null_upgrade_step"\n+ title="Add a timezone property to portal memberdata if it is missing."\n+ handler=".final.add_the_timezone_property"\n />\n \n </gs:upgradeSteps>\ndiff --git a/plone/app/upgrade/v52/final.py b/plone/app/upgrade/v52/final.py\nindex 78aa1b58..c49cd866 100644\n--- a/plone/app/upgrade/v52/final.py\n+++ b/plone/app/upgrade/v52/final.py\n@@ -267,3 +267,11 @@ def secure_portal_setup_objects(context):\n return\n _recursive_strict_permission(context.snapshots)\n logger.info("Made portal_setup snapshots only available for Manager and Owner.")\n+\n+\n+def add_the_timezone_property(context):\n+ """Ensure that the portal_memberdata tool has the timezone property."""\n+ portal_memberdata = getToolByName(context, "portal_memberdata")\n+ if portal_memberdata.hasProperty("timezone"):\n+ return\n+ portal_memberdata.manage_addProperty("timezone", "", "string")\n' | ||
b"diff --git a/news/109.bugfix b/news/109.bugfix\nnew file mode 100644\nindex 00000000..a7f6796f\n--- /dev/null\n+++ b/news/109.bugfix\n@@ -0,0 +1 @@\n+Ensure that, when no timezone is selected, the value of the stored timezone is an empty string\ndiff --git a/plone/app/users/browser/account.py b/plone/app/users/browser/account.py\nindex 91c0e6c1..b6242ece 100644\n--- a/plone/app/users/browser/account.py\n+++ b/plone/app/users/browser/account.py\n@@ -138,6 +138,16 @@ def wysiwyg_editor(self, value):\n value = ''\n return self._setProperty('wysiwyg_editor', value)\n \n+ @property\n+ def timezone(self):\n+ return self._getProperty('timezone')\n+\n+ @timezone.setter\n+ def timezone(self, value):\n+ if value is None:\n+ value = ''\n+ return self._setProperty('timezone', value)\n+\n \n @implementer(IAccountPanelForm)\n class AccountPanelForm(AutoExtensibleForm, form.Form):\n" | ||
|