Skip to content

Commit

Permalink
[fc] Repository: plone.app.contentlisting
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2024-04-01T16:56:45-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.contentlisting@83595d5

Add image_scales support for RealContentListingObject

Files changed:
M plone/app/contentlisting/realobject.py
M plone/app/contentlisting/tests/test_integration_unit.py
Repository: plone.app.contentlisting

Branch: refs/heads/master
Date: 2024-04-01T17:01:27-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.contentlisting@80233ae

changelog

Files changed:
A news/64.bugfix
Repository: plone.app.contentlisting

Branch: refs/heads/master
Date: 2024-04-01T17:02:09-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.contentlisting@3a79161

fix test dependencies

Files changed:
M setup.py
Repository: plone.app.contentlisting

Branch: refs/heads/master
Date: 2024-04-01T17:03:09-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.contentlisting@4a6d32d

lint

Files changed:
M plone/app/contentlisting/tests/test_integration_unit.py
Repository: plone.app.contentlisting

Branch: refs/heads/master
Date: 2024-04-01T23:54:40-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.contentlisting@c99c7f8

Merge pull request #64 from plone/image-scales

Add image_scales support for RealContentListingObject

Files changed:
A news/64.bugfix
M plone/app/contentlisting/realobject.py
M plone/app/contentlisting/tests/test_integration_unit.py
M setup.py
  • Loading branch information
davisagli committed Apr 2, 2024
1 parent 8ea45ff commit 58b4385
Showing 1 changed file with 73 additions and 18 deletions.
91 changes: 73 additions & 18 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,81 @@
Repository: plone.restapi
Repository: plone.app.contentlisting


Branch: refs/heads/main
Date: 2024-04-01T22:17:00-07:00
Author: Hrittik (Hrittik20) <49366463+Hrittik20@users.noreply.github.com>
Commit: https://github.com/plone/plone.restapi/commit/5cf1418e928f143ef1b42fdc3e4ed72a3126e9dd
Branch: refs/heads/master
Date: 2024-04-01T16:56:45-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.contentlisting/commit/83595d5e3aeb2736e451502c79ea372d879b6597

Fix password reset when using email as login (#1767)
Add image_scales support for RealContentListingObject

* Fix password reset when using email as login

* Update test fail

* Fix black build

---------

Co-authored-by: Your Name &lt;you@example.com&gt;
Files changed:
M plone/app/contentlisting/realobject.py
M plone/app/contentlisting/tests/test_integration_unit.py

b'diff --git a/plone/app/contentlisting/realobject.py b/plone/app/contentlisting/realobject.py\nindex 23d890a..f8deb25 100644\n--- a/plone/app/contentlisting/realobject.py\n+++ b/plone/app/contentlisting/realobject.py\n@@ -1,11 +1,13 @@\n from Acquisition import aq_get\n from plone.app.contentlisting.contentlisting import BaseContentListingObject\n from plone.app.contentlisting.interfaces import IContentListingObject\n+from plone.base.interfaces import IImageScalesAdapter\n from plone.base.utils import base_hasattr\n from plone.base.utils import human_readable_size\n from plone.rfc822.interfaces import IPrimaryFieldInfo\n from plone.uuid.interfaces import IUUID\n from Products.CMFCore.utils import getToolByName\n+from zope.component import getMultiAdapter\n from zope.interface import implementer\n \n \n@@ -105,3 +107,7 @@ def Type(self):\n def PortalType(self):\n obj = self.getObject()\n return obj.portal_type\n+\n+ def image_scales(self):\n+ obj = self.getObject()\n+ return getMultiAdapter((obj, self.request), IImageScalesAdapter)()\ndiff --git a/plone/app/contentlisting/tests/test_integration_unit.py b/plone/app/contentlisting/tests/test_integration_unit.py\nindex f4351d1..62d0781 100644\n--- a/plone/app/contentlisting/tests/test_integration_unit.py\n+++ b/plone/app/contentlisting/tests/test_integration_unit.py\n@@ -4,11 +4,16 @@\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\n from plone.batching.interfaces import IBatch\n+from plone.namedfile.file import NamedBlobImage\n from Products.CMFCore.utils import getToolByName\n from zope.interface.verify import verifyObject\n \n+import base64\n import unittest\n \n+TEST_IMAGE_DATA = base64.b64decode(\n+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="\n+)\n \n class TestSetup(unittest.TestCase):\n layer = CONTENTLISTING_FUNCTIONAL_TESTING\n@@ -265,6 +270,21 @@ def test_item_get_none(self):\n "result in an AttributeError."\n )\n \n+ def test_item_image_scales(self):\n+ self.folder.invokeFactory(\n+ "Image",\n+ "myimage",\n+ title="My Image",\n+ )\n+ myimage = self.folder.myimage\n+ myimage.image = NamedBlobImage(\n+ data=TEST_IMAGE_DATA,\n+ filename="test.png",\n+ )\n+ item = IContentListingObject(myimage)\n+ image_scales = item.image_scales()\n+ self.assertIn("download", image_scales["image"][0])\n+\n \n class TestFolderContents(unittest.TestCase):\n """Testing that the folder contents browserview works and behaves\n'

Repository: plone.app.contentlisting


Branch: refs/heads/master
Date: 2024-04-01T17:01:27-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.contentlisting/commit/80233ae511b2c9c3ec90122089683b0006886f6c

changelog

Files changed:
A news/64.bugfix

b'diff --git a/news/64.bugfix b/news/64.bugfix\nnew file mode 100644\nindex 0000000..f279ef8\n--- /dev/null\n+++ b/news/64.bugfix\n@@ -0,0 +1 @@\n+Support image_scales in RealContentListingObject. @davisagli\n'

Repository: plone.app.contentlisting


Branch: refs/heads/master
Date: 2024-04-01T17:02:09-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.contentlisting/commit/3a79161b47d773f7ea0324d4b64aaa07ddba80bc

fix test dependencies

Files changed:
M setup.py

b'diff --git a/setup.py b/setup.py\nindex aa923c9..2d8afa5 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -54,6 +54,7 @@\n "plone.app.contenttypes[test]",\n "plone.app.testing",\n "plone.batching",\n+ "plone.namedfile",\n "plone.testing",\n ],\n },\n'

Repository: plone.app.contentlisting


Branch: refs/heads/master
Date: 2024-04-01T17:03:09-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.contentlisting/commit/4a6d32dde07f59a4f4ad0fa2cdbcd057e2e09255

lint

Files changed:
M plone/app/contentlisting/tests/test_integration_unit.py

b'diff --git a/plone/app/contentlisting/tests/test_integration_unit.py b/plone/app/contentlisting/tests/test_integration_unit.py\nindex 62d0781..83134c5 100644\n--- a/plone/app/contentlisting/tests/test_integration_unit.py\n+++ b/plone/app/contentlisting/tests/test_integration_unit.py\n@@ -11,10 +11,12 @@\n import base64\n import unittest\n \n+\n TEST_IMAGE_DATA = base64.b64decode(\n "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="\n )\n \n+\n class TestSetup(unittest.TestCase):\n layer = CONTENTLISTING_FUNCTIONAL_TESTING\n \n'

Repository: plone.app.contentlisting


Branch: refs/heads/master
Date: 2024-04-01T23:54:40-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.contentlisting/commit/c99c7f80a3d88f6397e315daacebb41b77a4dcdd

Merge pull request #64 from plone/image-scales

Add image_scales support for RealContentListingObject

Files changed:
A news/943.bugfix
M src/plone/restapi/services/users/add.py
A news/64.bugfix
M plone/app/contentlisting/realobject.py
M plone/app/contentlisting/tests/test_integration_unit.py
M setup.py

b'diff --git a/news/943.bugfix b/news/943.bugfix\nnew file mode 100644\nindex 000000000..8a04b5f28\n--- /dev/null\n+++ b/news/943.bugfix\n@@ -0,0 +1 @@\n+Fixed password reset issue by replacing `username` with `target_user` to correctly authenticate using email. @Hrittik20\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/services/users/add.py b/src/plone/restapi/services/users/add.py\nindex 2750d401f..b0136a215 100644\n--- a/src/plone/restapi/services/users/add.py\n+++ b/src/plone/restapi/services/users/add.py\n@@ -341,7 +341,9 @@ def update_password(self, data):\n )\n \n check_password_auth = pas.authenticate(\n- username, old_password.encode("utf-8"), self.request\n+ target_user.getUser().getUserName(),\n+ old_password.encode("utf-8"),\n+ self.request,\n )\n if not check_password_auth:\n return self._error(\n'
b'diff --git a/news/64.bugfix b/news/64.bugfix\nnew file mode 100644\nindex 0000000..f279ef8\n--- /dev/null\n+++ b/news/64.bugfix\n@@ -0,0 +1 @@\n+Support image_scales in RealContentListingObject. @davisagli\ndiff --git a/plone/app/contentlisting/realobject.py b/plone/app/contentlisting/realobject.py\nindex 23d890a..f8deb25 100644\n--- a/plone/app/contentlisting/realobject.py\n+++ b/plone/app/contentlisting/realobject.py\n@@ -1,11 +1,13 @@\n from Acquisition import aq_get\n from plone.app.contentlisting.contentlisting import BaseContentListingObject\n from plone.app.contentlisting.interfaces import IContentListingObject\n+from plone.base.interfaces import IImageScalesAdapter\n from plone.base.utils import base_hasattr\n from plone.base.utils import human_readable_size\n from plone.rfc822.interfaces import IPrimaryFieldInfo\n from plone.uuid.interfaces import IUUID\n from Products.CMFCore.utils import getToolByName\n+from zope.component import getMultiAdapter\n from zope.interface import implementer\n \n \n@@ -105,3 +107,7 @@ def Type(self):\n def PortalType(self):\n obj = self.getObject()\n return obj.portal_type\n+\n+ def image_scales(self):\n+ obj = self.getObject()\n+ return getMultiAdapter((obj, self.request), IImageScalesAdapter)()\ndiff --git a/plone/app/contentlisting/tests/test_integration_unit.py b/plone/app/contentlisting/tests/test_integration_unit.py\nindex f4351d1..83134c5 100644\n--- a/plone/app/contentlisting/tests/test_integration_unit.py\n+++ b/plone/app/contentlisting/tests/test_integration_unit.py\n@@ -4,12 +4,19 @@\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\n from plone.batching.interfaces import IBatch\n+from plone.namedfile.file import NamedBlobImage\n from Products.CMFCore.utils import getToolByName\n from zope.interface.verify import verifyObject\n \n+import base64\n import unittest\n \n \n+TEST_IMAGE_DATA = base64.b64decode(\n+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="\n+)\n+\n+\n class TestSetup(unittest.TestCase):\n layer = CONTENTLISTING_FUNCTIONAL_TESTING\n \n@@ -265,6 +272,21 @@ def test_item_get_none(self):\n "result in an AttributeError."\n )\n \n+ def test_item_image_scales(self):\n+ self.folder.invokeFactory(\n+ "Image",\n+ "myimage",\n+ title="My Image",\n+ )\n+ myimage = self.folder.myimage\n+ myimage.image = NamedBlobImage(\n+ data=TEST_IMAGE_DATA,\n+ filename="test.png",\n+ )\n+ item = IContentListingObject(myimage)\n+ image_scales = item.image_scales()\n+ self.assertIn("download", image_scales["image"][0])\n+\n \n class TestFolderContents(unittest.TestCase):\n """Testing that the folder contents browserview works and behaves\ndiff --git a/setup.py b/setup.py\nindex aa923c9..2d8afa5 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -54,6 +54,7 @@\n "plone.app.contenttypes[test]",\n "plone.app.testing",\n "plone.batching",\n+ "plone.namedfile",\n "plone.testing",\n ],\n },\n'

0 comments on commit 58b4385

Please sign in to comment.