mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
Merge pull request #10021 from AlanCoding/black_upgrade
Modify formatting in response to black update This seems to have changed sometime between versions 20.8b1 and 21.4b0 Reviewed-by: Seth Foster <None> Reviewed-by: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
commit
1e7b7d1a30
@ -789,7 +789,7 @@ class RetrieveUpdateAPIView(RetrieveAPIView, generics.RetrieveUpdateAPIView):
|
||||
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
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
@ -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,)
|
||||
@ -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)
|
||||
@ -1596,7 +1596,7 @@ class InventoryHostsList(HostRelatedSearchMixin, SubListCreateAttachDetachAPIVie
|
||||
|
||||
|
||||
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
|
||||
@ -1618,7 +1618,7 @@ class HostGroupsList(ControlledByScmMixin, SubListCreateAttachDetachAPIView):
|
||||
|
||||
|
||||
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
|
||||
@ -1858,7 +1858,7 @@ class GroupPotentialChildrenList(SubListAPIView):
|
||||
|
||||
|
||||
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
|
||||
@ -1883,7 +1883,7 @@ class GroupHostsList(HostRelatedSearchMixin, ControlledByScmMixin, SubListCreate
|
||||
|
||||
|
||||
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
|
||||
|
||||
@ -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":
|
||||
|
||||
@ -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()
|
||||
@ -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)
|
||||
|
||||
@ -28,7 +28,7 @@ class SettingSerializer(BaseSerializer):
|
||||
|
||||
|
||||
class SettingCategorySerializer(serializers.Serializer):
|
||||
"""Serialize setting category """
|
||||
"""Serialize setting category"""
|
||||
|
||||
url = serializers.CharField(read_only=True)
|
||||
slug = serializers.CharField(read_only=True)
|
||||
|
||||
@ -354,7 +354,7 @@ class PrimordialModel(HasEditsMixin, CreatedModifiedModel):
|
||||
|
||||
|
||||
class CommonModel(PrimordialModel):
|
||||
''' a base model where the name is unique '''
|
||||
'''a base model where the name is unique'''
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
@ -366,7 +366,7 @@ class CommonModel(PrimordialModel):
|
||||
|
||||
|
||||
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
|
||||
|
||||
@ -1224,7 +1224,7 @@ class UnifiedJob(
|
||||
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))
|
||||
|
||||
@ -2,7 +2,7 @@ from collections import deque
|
||||
|
||||
|
||||
class SimpleDAG(object):
|
||||
''' A simple implementation of a directed acyclic graph '''
|
||||
'''A simple implementation of a directed acyclic graph'''
|
||||
|
||||
def __init__(self):
|
||||
self.nodes = []
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
|
||||
@ -311,7 +311,7 @@ class TestSurveySpecValidation:
|
||||
|
||||
@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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user