Modify formatting in response to black update

This commit is contained in:
Alan Rominger
2021-04-26 10:51:27 -04:00
parent 0bdd873bd3
commit 67f7998ab9
10 changed files with 18 additions and 18 deletions

View File

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

View File

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

View File

@@ -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":

View File

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