Skip to content

Commit

Permalink
style: Fix some lint issues that had been amnestied
Browse files Browse the repository at this point in the history
Several now-irrelevant lint-disables and one legit one that was easy to
fix.
  • Loading branch information
timmc-edx committed Sep 30, 2024
1 parent 660c30b commit 7b1519f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def test_range_request_multiple_ranges(self):
"""
first_byte = self.length_unlocked / 4
last_byte = self.length_unlocked / 2
# lint-amnesty, pylint: disable=bad-option-value, unicode-format-string
resp = self.client.get(self.url_unlocked, HTTP_RANGE='bytes={first}-{last}, -100'.format(
first=first_byte, last=last_byte))

Expand Down
7 changes: 2 additions & 5 deletions openedx/core/djangoapps/contentserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def process_request(request):
"""Process the given request"""
asset_path = request.path

if is_asset_request(request): # lint-amnesty, pylint: disable=too-many-nested-blocks
if is_asset_request(request):
# Make sure we can convert this request into a location.
if AssetLocator.CANONICAL_NAMESPACE in asset_path:
asset_path = asset_path.replace('block/', 'block@', 1)
Expand Down Expand Up @@ -294,10 +294,7 @@ def load_asset_from_location(location):
content = get_cached_content(location)
if content is None:
# Not in cache, so just try and load it from the asset manager.
try:
content = AssetManager.find(location, as_stream=True)
except (ItemNotFoundError, NotFoundError): # lint-amnesty, pylint: disable=try-except-raise
raise
content = AssetManager.find(location, as_stream=True)

# Now that we fetched it, let's go ahead and try to cache it. We cap this at 1MB
# because it's the default for memcached and also we don't want to do too much
Expand Down

0 comments on commit 7b1519f

Please sign in to comment.