Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vysakh-menon-aot committed Nov 4, 2024
1 parent ffc242e commit a154ba9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
1 change: 0 additions & 1 deletion jobs/update-colin-filings/update_colin_filings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
This module is the API for the Legal Entity system.
"""
import logging
import math
import os

import requests
Expand Down
30 changes: 15 additions & 15 deletions jobs/update-legal-filings/update_legal_filings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@

def create_app(run_mode=os.getenv('FLASK_ENV', 'production')):
"""Return a configured Flask App using the Factory method."""
app = Flask(__name__)
app.config.from_object(config.CONFIGURATION[run_mode])
application = Flask(__name__)
application.config.from_object(config.CONFIGURATION[run_mode])
# Configure Sentry
if app.config.get('SENTRY_DSN', None):
if application.config.get('SENTRY_DSN', None):
sentry_sdk.init(
dsn=app.config.get('SENTRY_DSN'),
dsn=application.config.get('SENTRY_DSN'),
integrations=[SENTRY_LOGGING]
)

register_shellcontext(app)
register_shellcontext(application)

# Static class load the variables while importing the class for the first time,
# By then config is not loaded, so it never get the config value
AccountService.timeout = int(app.config.get('ACCOUNT_SVC_TIMEOUT'))
AccountService.timeout = int(application.config.get('ACCOUNT_SVC_TIMEOUT'))

return app
return application


def register_shellcontext(app):
def register_shellcontext(application):
"""Register shell context objects."""
def shell_context():
"""Shell context objects."""
return {'app': app}
return {'app': application}

app.shell_context_processor(shell_context)
application.shell_context_processor(shell_context)


def check_for_manual_filings(application: Flask = None, token: dict = None):
Expand Down Expand Up @@ -357,9 +357,9 @@ async def update_business_nos(application, qsm): # pylint: disable=redefined-ou


if __name__ == '__main__':
application = create_app()
with application.app_context():
update_filings(application)
app = create_app()
with app.app_context():
update_filings(app)
event_loop = asyncio.get_event_loop()
qsm = QueueService(app=application, loop=event_loop)
event_loop.run_until_complete(update_business_nos(application, qsm))
qsm = QueueService(app=app, loop=event_loop)
event_loop.run_until_complete(update_business_nos(app, qsm))
2 changes: 1 addition & 1 deletion legal-api/src/legal_api/models/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def get_all_by_no_tax_id(cls):
businesses = (db.session.query(Business.identifier)
.filter(
~Business.legal_type.in_(no_tax_id_types),
Business.tax_id == None) # pylint: disable=singleton-comparison # noqa: E711;
Business.tax_id == None) # pylint: disable=singleton-comparison # noqa: E711;
.all())
return businesses

Expand Down

0 comments on commit a154ba9

Please sign in to comment.