1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #2000: Remove support for Python 2

This commit is contained in:
Jeremy Stretch
2018-08-14 11:47:54 -04:00
parent cd2aee3053
commit ac546a9711
10 changed files with 17 additions and 59 deletions

View File

@ -72,11 +72,7 @@ class ExceptionHandlingMiddleware(object):
custom_template = 'exceptions/programming_error.html'
elif isinstance(exception, ImportError):
custom_template = 'exceptions/import_error.html'
elif (
sys.version_info[0] >= 3 and isinstance(exception, PermissionError)
) or (
isinstance(exception, OSError) and exception.errno == 13
):
elif isinstance(exception, PermissionError):
custom_template = 'exceptions/permission_error.html'
# Return a custom error message, or fall back to Django's default 500 error handling