move code linting to a stricter pep8-esque auto-formatting tool, black

This commit is contained in:
Ryan Petrello
2021-03-19 12:44:51 -04:00
parent 9b702e46fe
commit c2ef0a6500
671 changed files with 20538 additions and 21924 deletions

View File

@@ -2,4 +2,3 @@
# All Rights Reserved.
default_app_config = 'awx.ui.apps.UIConfig'

View File

@@ -7,4 +7,3 @@ class UIConfig(AppConfig):
name = 'awx.ui'
verbose_name = _('UI')

View File

@@ -12,11 +12,7 @@ from awx.ui.fields import PendoTrackingStateField, CustomLogoField # noqa
register(
'PENDO_TRACKING_STATE',
field_class=PendoTrackingStateField,
choices=[
('off', _('Off')),
('anonymous', _('Anonymous')),
('detailed', _('Detailed')),
],
choices=[('off', _('Off')), ('anonymous', _('Anonymous')), ('detailed', _('Detailed'))],
label=_('User Analytics Tracking State'),
help_text=_('Enable or Disable User Analytics Tracking.'),
category=_('UI'),
@@ -29,10 +25,12 @@ register(
allow_blank=True,
default='',
label=_('Custom Login Info'),
help_text=_('If needed, you can add specific information (such as a legal '
'notice or a disclaimer) to a text box in the login modal using '
'this setting. Any content added must be in plain text or an '
'HTML fragment, as other markup languages are not supported.'),
help_text=_(
'If needed, you can add specific information (such as a legal '
'notice or a disclaimer) to a text box in the login modal using '
'this setting. Any content added must be in plain text or an '
'HTML fragment, as other markup languages are not supported.'
),
category=_('UI'),
category_slug='ui',
)
@@ -43,9 +41,11 @@ register(
allow_blank=True,
default='',
label=_('Custom Logo'),
help_text=_('To set up a custom logo, provide a file that you create. For '
'the custom logo to look its best, use a .png file with a '
'transparent background. GIF, PNG and JPEG formats are supported.'),
help_text=_(
'To set up a custom logo, provide a file that you create. For '
'the custom logo to look its best, use a .png file with a '
'transparent background. GIF, PNG and JPEG formats are supported.'
),
placeholder='data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=',
category=_('UI'),
category_slug='ui',
@@ -56,8 +56,7 @@ register(
field_class=fields.IntegerField,
min_value=100,
label=_('Max Job Events Retrieved by UI'),
help_text=_('Maximum number of job events for the UI to retrieve within a '
'single request.'),
help_text=_('Maximum number of job events for the UI to retrieve within a ' 'single request.'),
category=_('UI'),
category_slug='ui',
)
@@ -66,9 +65,7 @@ register(
'UI_LIVE_UPDATES_ENABLED',
field_class=fields.BooleanField,
label=_('Enable Live Updates in the UI'),
help_text=_('If disabled, the page will not refresh when events are received. '
'Reloading the page will be required to get the latest details.'),
help_text=_('If disabled, the page will not refresh when events are received. ' 'Reloading the page will be required to get the latest details.'),
category=_('UI'),
category_slug='ui',
)

View File

@@ -3,6 +3,4 @@ import os
def csp(request):
return {
'csp_nonce': base64.encodebytes(os.urandom(32)).decode().rstrip(),
}
return {'csp_nonce': base64.encodebytes(os.urandom(32)).decode().rstrip()}

View File

@@ -14,7 +14,6 @@ from awx.conf import fields, register
class PendoTrackingStateField(fields.ChoiceField):
def to_internal_value(self, data):
# Any false/null values get converted to 'off'.
if data in fields.NullBooleanField.FALSE_VALUES or data in fields.NullBooleanField.NULL_VALUES:
@@ -42,4 +41,3 @@ class CustomLogoField(fields.CharField):
except (TypeError, binascii.Error):
self.fail('invalid_data')
return data