Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
em1208 committed Oct 12, 2024
1 parent 6dfd874 commit 13b8515
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 3 additions & 1 deletion adrf/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ async def ato_representation(self, instance):
if check_for_none is None:
ret[field.field_name] = None
else:
if asyncio.iscoroutinefunction(getattr(field, "ato_representation", None)):
if asyncio.iscoroutinefunction(
getattr(field, "ato_representation", None)
):
repr = await field.ato_representation(attribute)
else:
repr = field.to_representation(attribute)
Expand Down
8 changes: 1 addition & 7 deletions tests/test_routers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from asgiref.sync import async_to_sync
from django.contrib.auth.models import User
from django.test import Client, TestCase, override_settings
from rest_framework import status
from rest_framework.response import Response
from rest_framework.test import APIRequestFactory
from rest_framework.viewsets import ModelViewSet as DRFModelViewSet

from adrf.routers import SimpleRouter, DefaultRouter
from adrf.serializers import ModelSerializer
from adrf.routers import SimpleRouter
from adrf.viewsets import ModelViewSet as AsyncModelViewSet
from tests.test_views import JSON_ERROR, sanitise_json_error


class SyncViewSet(DRFModelViewSet):
Expand Down

0 comments on commit 13b8515

Please sign in to comment.