diff --git a/app/__init__.py b/app/__init__.py index cb2980405..c1419165e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -357,17 +357,17 @@ def setup_sqlalchemy_events(app): # need this or db.engine isn't accessible with app.app_context(): @event.listens_for(db.engine, 'connect') - def connect(dbapi_connection, connection_record): + def connect(): # connection first opened with db TOTAL_DB_CONNECTIONS.inc() @event.listens_for(db.engine, 'close') - def close(dbapi_connection, connection_record): + def close(): # connection closed (probably only happens with overflow connections) TOTAL_DB_CONNECTIONS.dec() @event.listens_for(db.engine, 'checkout') - def checkout(dbapi_connection, connection_record, connection_proxy): + def checkout(connection_record): try: # connection given to a web worker TOTAL_CHECKED_OUT_DB_CONNECTIONS.inc() @@ -405,7 +405,7 @@ def setup_sqlalchemy_events(app): current_app.logger.exception("Exception caught for checkout event.") @event.listens_for(db.engine, 'checkin') - def checkin(dbapi_connection, connection_record): + def checkin(connection_record): try: # connection returned by a web worker TOTAL_CHECKED_OUT_DB_CONNECTIONS.dec() diff --git a/app/commands.py b/app/commands.py index 8039fd9b6..8dd7d3b7b 100644 --- a/app/commands.py +++ b/app/commands.py @@ -572,8 +572,9 @@ def populate_annual_billing_with_defaults(year, missing_services_only): print(f'update service {service.id} with default') set_default_free_allowance_for_service(service, year) - -def validate_mobile(ctx, param, value): +# We use noqa to protect this method from the vulture dead code check. Otherwise, the params ctx and param +# will trigger vulture and cause a build failure. +def validate_mobile(ctx, param, value): # noqa if (len(''.join(i for i in value if i.isdigit())) != 10): raise click.BadParameter("mobile number must have 10 digits") else: