mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Please don't hate on flake8
This commit is contained in:
parent
fbe82d9348
commit
53b16c09e8
@ -237,8 +237,7 @@ class ApiV1ConfigView(APIView):
|
||||
# Sanity check: If this license includes system tracking, make
|
||||
# sure that we have a valid MongoDB to point to, and complain if
|
||||
# we do not.
|
||||
if (license_data['features']['system_tracking'] and
|
||||
settings.MONGO_HOST == NotImplemented): # noqa
|
||||
if (license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented):
|
||||
return Response({
|
||||
'error': 'This license supports system tracking, which '
|
||||
'requires MongoDB to be installed. Since you are '
|
||||
|
@ -20,14 +20,12 @@ try:
|
||||
raise ConnectionError
|
||||
|
||||
# Attempt to connect to the MongoDB database.
|
||||
# P.S. Flake8 is terrible. This indentation is consistent with PEP8.
|
||||
connect(settings.MONGO_DB,
|
||||
host=settings.MONGO_HOST, # noqa
|
||||
port=int(settings.MONGO_PORT), # noqa
|
||||
username=settings.MONGO_USERNAME, # noqa
|
||||
password=settings.MONGO_PASSWORD, # noqa
|
||||
tz_aware=settings.USE_TZ, # noqa
|
||||
) # noqa
|
||||
host=settings.MONGO_HOST,
|
||||
port=int(settings.MONGO_PORT),
|
||||
username=settings.MONGO_USERNAME,
|
||||
password=settings.MONGO_PASSWORD,
|
||||
tz_aware=settings.USE_TZ)
|
||||
register_key_transform(get_db())
|
||||
except ConnectionError:
|
||||
logger.warn('Failed to establish connect to MongoDB "%s"' % (settings.MONGO_DB))
|
||||
|
Loading…
Reference in New Issue
Block a user