diff --git a/app/aws/s3.py b/app/aws/s3.py index b7f445827..fcca58dd0 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -44,7 +44,7 @@ def list_s3_objects(): ) else: break - except Exception as e: + except Exception: current_app.logger.error( f"An error occurred while regenerating cache #notify-admin-1200", exc_info=True, @@ -116,7 +116,7 @@ def download_from_s3( except botocore.exceptions.PartialCredentialsError as pce: current_app.logger.error("Incomplete credentials provided", exc_info=True) raise Exception(pce) - except Exception as e: + except Exception: current_app.logger.error(f"An error occurred", exc_info=True) text = f"EXCEPTION local_filename {local_filename}" raise Exception(text) @@ -191,7 +191,7 @@ def get_job_from_s3(service_id, job_id): sleep_time = backoff_factor * (2**retries) # Exponential backoff time.sleep(sleep_time) continue - except Exception as e: + except Exception: current_app.logger.error(f"Failed to get object from bucket", exc_info=True) raise diff --git a/app/commands.py b/app/commands.py index 1c5a4e749..3a7e48e4d 100644 --- a/app/commands.py +++ b/app/commands.py @@ -300,8 +300,8 @@ def bulk_invite_user_to_service(file_name, service_id, user_id, auth_type, permi current_app.logger.warning( f"*** ERROR occurred for email address: {email_address.strip()}" ) - current_app.logger, info(response[0].get_data(as_text=True)) - except Exception as e: + current_app.logger.info(response[0].get_data(as_text=True)) + except Exception: current_app.logger.error( f"*** ERROR occurred for email address: {email_address.strip()}.", exc_info=True, @@ -531,7 +531,7 @@ def populate_go_live(file_name): go_live_user = None except NoResultFound: current_app.logger.error( - f"No user found for email address", exc_info=True + "No user found for email address", exc_info=True ) continue try: @@ -1070,4 +1070,4 @@ def add_test_users_to_db(generate, state, admin): state=state, platform_admin=admin, ) - currente_app.logger.info(f"{num} {user.email_address} created") + current_app.logger.info(f"{num} {user.email_address} created") diff --git a/app/dao/users_dao.py b/app/dao/users_dao.py index 458a5661c..9f0f389b8 100644 --- a/app/dao/users_dao.py +++ b/app/dao/users_dao.py @@ -43,7 +43,7 @@ def get_login_gov_user(login_uuid, email_address): if user.email_address != email_address: try: save_user_attribute(user, {"email_address": email_address}) - except sqlalchemy.exc.IntegrityError as ie: + except sqlalchemy.exc.IntegrityError: # We are trying to change the email address as a courtesy, # based on the assumption that the user has somehow changed their # address in login.gov. diff --git a/app/notifications/sns_handlers.py b/app/notifications/sns_handlers.py index 243fefd9d..d288750a5 100644 --- a/app/notifications/sns_handlers.py +++ b/app/notifications/sns_handlers.py @@ -45,9 +45,9 @@ def sns_notification_handler(data, headers): try: validate_sns_cert(message) - except Exception as e: + except Exception: current_app.logger.error( - f"SES-SNS callback failed: validation failed with error: Signature validation failed", + "SES-SNS callback failed: validation failed with error: Signature validation failed", exc_info=True, ) raise InvalidRequest("SES-SNS callback failed: validation failed", 400) diff --git a/app/service/rest.py b/app/service/rest.py index cb3a8feb4..2791a086b 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -107,7 +107,7 @@ from app.service.service_senders_schema import ( ) from app.service.utils import get_guest_list_objects from app.user.users_schema import post_set_permissions_schema -from app.utils import get_prev_next_pagination_links, hilite, utc_now +from app.utils import get_prev_next_pagination_links, utc_now service_blueprint = Blueprint("service", __name__) diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index 7f11f218d..dd76ad2bd 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -24,7 +24,7 @@ from app.notifications.process_notifications import ( send_notification_to_queue, ) from app.schemas import invited_user_schema -from app.utils import hilite, utc_now +from app.utils import utc_now from notifications_utils.url_safe_token import check_token, generate_token service_invite = Blueprint("service_invite", __name__)