style: Fix some lint issues that had been amnestied

Several now-irrelevant lint-disables and one legit one that was easy to
fix.
This commit is contained in:
Tim McCormack
2024-09-30 14:16:05 +00:00
parent 660c30bb2b
commit 7b1519f82e
2 changed files with 2 additions and 6 deletions

View File

@@ -246,7 +246,6 @@ class ContentStoreToyCourseTest(SharedModuleStoreTestCase):
"""
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))

View File

@@ -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)
@@ -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