Skip to content

Commit

Permalink
- lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Sep 9, 2023
1 parent 94b341b commit e5f28fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/OFS/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def getZMIMainFrameTarget(self, REQUEST):
# Only allow a passed-in ``came_from`` URL if it is local (just a path)
# or if the URL scheme and hostname are the same as our own
if (not parsed_came_from.scheme and not parsed_came_from.netloc) or \
(parsed_parent_url.scheme == parsed_came_from.scheme and
parsed_parent_url.netloc == parsed_came_from.netloc):
(parsed_parent_url.scheme == parsed_came_from.scheme
and parsed_parent_url.netloc == parsed_came_from.netloc):
return came_from

return default
Expand Down
4 changes: 1 addition & 3 deletions src/OFS/tests/testApplication.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import unittest
from urllib.parse import urlparse

from Testing.ZopeTestCase import FunctionalTestCase

Expand Down Expand Up @@ -128,7 +127,6 @@ def test_getZMIMainFrameTarget(self):

for URL1 in ('http://nohost', 'https://nohost/some/path'):
request = {'URL1': URL1}
parsed_url1 = urlparse(URL1)

# No came_from at all
self.assertEqual(app.getZMIMainFrameTarget(request),
Expand All @@ -145,7 +143,7 @@ def test_getZMIMainFrameTarget(self):
# Local (path only) came_from
request['came_from'] = '/new/path'
self.assertEqual(app.getZMIMainFrameTarget(request),
f'/new/path')
'/new/path')

# came_from URL outside our own server
request['came_from'] = 'https://www.zope.dev/index.html'
Expand Down

0 comments on commit e5f28fd

Please sign in to comment.