Skip to content

Commit

Permalink
Do not fail on startup when the requests library is missing.
Browse files Browse the repository at this point in the history
Conditionally load the views to migrate to Volto: only when the ``requests`` library is available.
We don't want to make this a hard dependency.
If you need the migration views, you should include the ``requests`` package yourself.
Fixes #152
  • Loading branch information
mauritsvanrees committed Jun 18, 2024
1 parent 9e35613 commit 2f42bc4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
5 changes: 5 additions & 0 deletions news/152.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Do not fail on startup when the ``requests`` library is missing.
Conditionally load the views to migrate to Volto: only when the ``requests`` library is available.
We don't want to make this a hard dependency.
If you need the migration views, you should include the ``requests`` package yourself.
[maurits]
34 changes: 18 additions & 16 deletions src/plone/volto/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,25 @@
zcml:condition="have plone-5"
/>

<browser:page
name="migrate_richtext"
for="zope.interface.Interface"
class=".migrate_richtext.MigrateRichTextToVoltoBlocks"
template="migrate_richtext.pt"
permission="cmf.ManagePortal"
zcml:condition="have plone-60"
/>
<configure zcml:condition="installed requests">
<browser:page
name="migrate_richtext"
for="zope.interface.Interface"
class=".migrate_richtext.MigrateRichTextToVoltoBlocks"
template="migrate_richtext.pt"
permission="cmf.ManagePortal"
zcml:condition="have plone-60"
/>

<browser:page
name="migrate_to_volto"
for="zope.interface.Interface"
class=".migrate_to_volto.MigrateToVolto"
template="migrate_to_volto.pt"
permission="cmf.ManagePortal"
zcml:condition="have plone-60"
/>
<browser:page
name="migrate_to_volto"
for="zope.interface.Interface"
class=".migrate_to_volto.MigrateToVolto"
template="migrate_to_volto.pt"
permission="cmf.ManagePortal"
zcml:condition="have plone-60"
/>
</configure>

<browser:viewlet
name="voltobackendwarning"
Expand Down

0 comments on commit 2f42bc4

Please sign in to comment.