diff --git a/InvenTree/InvenTree/exchange.py b/InvenTree/InvenTree/exchange.py index 936dd7a76e..4b99953382 100644 --- a/InvenTree/InvenTree/exchange.py +++ b/InvenTree/InvenTree/exchange.py @@ -1,5 +1,5 @@ from common.settings import currency_code_default, currency_codes -from urllib.error import HTTPError, URLError +from urllib.error import URLError from djmoney.contrib.exchange.backends.base import SimpleExchangeBackend from django.db.utils import OperationalError @@ -31,7 +31,7 @@ class InvenTreeExchange(SimpleExchangeBackend): try: super().update_rates(base=base_currency, symbols=symbols) # catch connection errors - except (HTTPError, URLError): + except URLError: print('Encountered connection error while updating') except OperationalError as e: if 'SerializationFailure' in e.__cause__.__class__.__name__: diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py index 0d7a4f46f7..a9c43c71b6 100644 --- a/InvenTree/InvenTree/middleware.py +++ b/InvenTree/InvenTree/middleware.py @@ -65,7 +65,6 @@ class AuthRequiredMiddleware(object): except Token.DoesNotExist: logger.warning(f"Access denied for unknown token {token_key}") - pass # No authorization was found for the request if not authorized: diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index 71bcf4889b..c60b9a7a77 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -205,7 +205,7 @@ def ExportBom(part, fmt='csv', cascade=False, max_levels=None, parameter_data=Fa supplier_parts_used.add(sp_part) - if sp_part.supplier and sp_part.supplier: + if sp_part.supplier: supplier_name = sp_part.supplier.name else: supplier_name = ''