Skip to content

Commit

Permalink
Modify formatting in response to black update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Apr 26, 2021
1 parent 0bdd873 commit 67f7998
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion awx/api/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def partial_update(self, request, *args, **kwargs):
return super(RetrieveUpdateAPIView, self).partial_update(request, *args, **kwargs)

def update_filter(self, request, *args, **kwargs):
''' scrub any fields the user cannot/should not put/patch, based on user context. This runs after read-only serialization filtering '''
'''scrub any fields the user cannot/should not put/patch, based on user context. This runs after read-only serialization filtering'''
pass


Expand Down
14 changes: 7 additions & 7 deletions awx/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class DashboardView(APIView):
swagger_topic = 'Dashboard'

def get(self, request, format=None):
''' Show Dashboard Details '''
'''Show Dashboard Details'''
data = OrderedDict()
data['related'] = {'jobs_graph': reverse('api:dashboard_jobs_graph_view', request=request)}
user_inventory = get_user_queryset(request.user, models.Inventory)
Expand Down Expand Up @@ -542,7 +542,7 @@ class ScheduleUnifiedJobsList(SubListAPIView):


class AuthView(APIView):
''' List enabled single-sign-on endpoints '''
'''List enabled single-sign-on endpoints'''

authentication_classes = []
permission_classes = (AllowAny,)
Expand Down Expand Up @@ -1233,7 +1233,7 @@ class UserDetail(RetrieveUpdateDestroyAPIView):
serializer_class = serializers.UserSerializer

def update_filter(self, request, *args, **kwargs):
''' make sure non-read-only fields that can only be edited by admins, are only edited by admins '''
'''make sure non-read-only fields that can only be edited by admins, are only edited by admins'''
obj = self.get_object()
can_change = request.user.can_access(models.User, 'change', obj, request.data)
can_admin = request.user.can_access(models.User, 'admin', obj, request.data)
Expand Down Expand Up @@ -1596,7 +1596,7 @@ def get_queryset(self):


class HostGroupsList(ControlledByScmMixin, SubListCreateAttachDetachAPIView):
''' the list of groups a host is directly a member of '''
'''the list of groups a host is directly a member of'''

model = models.Group
serializer_class = serializers.GroupSerializer
Expand All @@ -1618,7 +1618,7 @@ def create(self, request, *args, **kwargs):


class HostAllGroupsList(SubListAPIView):
''' the list of all groups of which the host is directly or indirectly a member '''
'''the list of all groups of which the host is directly or indirectly a member'''

model = models.Group
serializer_class = serializers.GroupSerializer
Expand Down Expand Up @@ -1858,7 +1858,7 @@ def get_queryset(self):


class GroupHostsList(HostRelatedSearchMixin, ControlledByScmMixin, SubListCreateAttachDetachAPIView):
''' the list of hosts directly below a group '''
'''the list of hosts directly below a group'''

model = models.Host
serializer_class = serializers.HostSerializer
Expand All @@ -1883,7 +1883,7 @@ def create(self, request, *args, **kwargs):


class GroupAllHostsList(HostRelatedSearchMixin, SubListAPIView):
''' the list of all hosts below a group, even including subgroups '''
'''the list of all hosts below a group, even including subgroups'''

model = models.Host
serializer_class = serializers.HostSerializer
Expand Down
2 changes: 1 addition & 1 deletion awx/api/views/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MetricsView(APIView):
renderer_classes = [renderers.PlainTextRenderer, renderers.PrometheusJSONRenderer, renderers.BrowsableAPIRenderer]

def get(self, request):
''' Show Metrics Details '''
'''Show Metrics Details'''
if request.user.is_superuser or request.user.is_system_auditor:
metrics_to_show = ''
if not request.query_params.get('subsystemonly', "0") == "1":
Expand Down
4 changes: 2 additions & 2 deletions awx/api/views/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ApiRootView(APIView):

@method_decorator(ensure_csrf_cookie)
def get(self, request, format=None):
''' List supported API versions '''
'''List supported API versions'''

v2 = reverse('api:api_v2_root_view', kwargs={'version': 'v2'})
data = OrderedDict()
Expand Down Expand Up @@ -78,7 +78,7 @@ class ApiVersionRootView(APIView):
swagger_topic = 'Versioning'

def get(self, request, format=None):
''' List top level resources '''
'''List top level resources'''
data = OrderedDict()
data['ping'] = reverse('api:api_v2_ping_view', request=request)
data['instances'] = reverse('api:instance_list', request=request)
Expand Down
2 changes: 1 addition & 1 deletion awx/conf/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, instance=None, data=serializers.empty, **kwargs):


class SettingCategorySerializer(serializers.Serializer):
"""Serialize setting category """
"""Serialize setting category"""

url = serializers.CharField(read_only=True)
slug = serializers.CharField(read_only=True)
Expand Down
4 changes: 2 additions & 2 deletions awx/main/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def validate_unique(self, exclude=None):


class CommonModel(PrimordialModel):
''' a base model where the name is unique '''
'''a base model where the name is unique'''

class Meta:
abstract = True
Expand All @@ -366,7 +366,7 @@ class Meta:


class CommonModelNameNotUnique(PrimordialModel):
''' a base model where the name is not unique '''
'''a base model where the name is not unique'''

class Meta:
abstract = True
Expand Down
2 changes: 1 addition & 1 deletion awx/main/models/unified_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ def task_impact(self):
raise NotImplementedError # Implement in subclass.

def websocket_emit_data(self):
''' Return extra data that should be included when submitting data to the browser over the websocket connection '''
'''Return extra data that should be included when submitting data to the browser over the websocket connection'''
websocket_data = dict(type=self.job_type_name)
if self.spawned_by_workflow:
websocket_data.update(dict(workflow_job_id=self.workflow_job_id, workflow_node_id=self.workflow_node_id))
Expand Down
2 changes: 1 addition & 1 deletion awx/main/scheduler/dag_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class SimpleDAG(object):
''' A simple implementation of a directed acyclic graph '''
'''A simple implementation of a directed acyclic graph'''

def __init__(self):
self.nodes = []
Expand Down
2 changes: 1 addition & 1 deletion awx/main/tests/functional/api/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_filterable_fields(options, instance, admin_user):

@pytest.mark.django_db
def test_handle_content_type(post, admin):
''' Tower should return 415 when wrong content type is in HTTP requests '''
'''Tower should return 415 when wrong content type is in HTTP requests'''
post(reverse('api:project_list'), {'name': 't', 'organization': None}, admin, content_type='text/html', expect=415)


Expand Down
2 changes: 1 addition & 1 deletion awx/main/tests/unit/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def test_survey_spec_element_missing_property(self):

@pytest.mark.parametrize('_type', ['integer', 'float'])
def test_survey_spec_element_number_empty_default(self, _type):
""" Assert that empty default is allowed for answer. """
"""Assert that empty default is allowed for answer."""
spec = self.spec_from_element({'type': _type, 'default': ''})
r = JobTemplateSurveySpec._validate_spec_data(spec, {})
assert r is None

0 comments on commit 67f7998

Please sign in to comment.