Applied pylint-amnesty to static_replace

This commit is contained in:
Jawayria
2021-02-02 13:34:19 +05:00
parent ad3ab3712e
commit 4dad2ab406
2 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
# lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring
import logging
import re
@@ -38,7 +38,7 @@ def try_staticfiles_lookup(path):
"""
try:
url = staticfiles_storage.url(path)
except Exception as err:
except Exception as err: # lint-amnesty, pylint: disable=broad-except
log.warning("staticfiles_storage couldn't find path {0}: {1}".format(
path, str(err)))
# Just return the original path; don't kill everything.
@@ -46,7 +46,7 @@ def try_staticfiles_lookup(path):
return url
def replace_jump_to_id_urls(text, course_id, jump_to_id_base_url):
def replace_jump_to_id_urls(text, course_id, jump_to_id_base_url): # lint-amnesty, pylint: disable=unused-argument
"""
This will replace a link to another piece of courseware to a 'jump_to'
URL that will redirect to the right place in the courseware
@@ -191,7 +191,7 @@ def replace_static_urls(text, data_directory=None, course_id=None, static_asset_
exists_in_staticfiles_storage = False
try:
exists_in_staticfiles_storage = staticfiles_storage.exists(rest)
except Exception as err:
except Exception as err: # lint-amnesty, pylint: disable=broad-except
log.warning("staticfiles_storage couldn't find path {0}: {1}".format(
rest, str(err)))
@@ -219,7 +219,7 @@ def replace_static_urls(text, data_directory=None, course_id=None, static_asset_
else:
url = staticfiles_storage.url(course_path)
# And if that fails, assume that it's course content, and add manually data directory
except Exception as err:
except Exception as err: # lint-amnesty, pylint: disable=broad-except
log.warning("staticfiles_storage couldn't find path {0}: {1}".format(
rest, str(err)))
url = "".join([prefix, course_path])