1
0
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:
James Laska 2015-06-05 12:46:07 -04:00
parent fbe82d9348
commit 53b16c09e8
2 changed files with 6 additions and 9 deletions

View File

@ -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 '

View File

@ -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))