Skip to content

Commit

Permalink
Do not assume request URL is a string. It might be None.
Browse files Browse the repository at this point in the history
This may happen on layer setup in tests if request was not initialized already properly.
Also check if there is a request at all.
  • Loading branch information
jensens committed Oct 7, 2020
1 parent ee56eaa commit 2ffe8b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plone/app/caching/purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ def purgeOnModified(object, event):
def purgeOnMovedOrRemoved(object, event):
request = getRequest()
confirmed_delete = (
'delete_confirmation' in request.URL
request
and request.URL is not None
and 'delete_confirmation' in request.URL
and request.REQUEST_METHOD == 'POST'
and 'form.submitted' in request.form
)
Expand Down

0 comments on commit 2ffe8b8

Please sign in to comment.