Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit e47e5a3

Browse files
lint
1 parent 7e5a1a9 commit e47e5a3

File tree

4 files changed

+11
-19
lines changed

4 files changed

+11
-19
lines changed

api/internal/gen_ai/serializers.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
from graphql_api.types.owner.owner import AI_FEATURES_GH_APP_ID
2-
from rest_framework.permissions import IsAuthenticated
3-
from rest_framework.response import Response
4-
from rest_framework.views import APIView
51
from rest_framework import serializers
62

7-
from codecov_auth.models import GithubAppInstallation, Owner
8-
from shared.django_apps.core.models import Repository
9-
from shared.license import get_current_license
10-
113

124
class GenAIAuthSerializer(serializers.Serializer):
135
is_valid = serializers.BooleanField()
146
repos = serializers.ListField(child=serializers.CharField(), required=False)
15-

api/internal/gen_ai/views.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
from graphql_api.types.owner.owner import AI_FEATURES_GH_APP_ID
21
from rest_framework.permissions import IsAuthenticated
32
from rest_framework.response import Response
43
from rest_framework.views import APIView
5-
from shared.license import get_current_license
6-
7-
from .serializers import GenAIAuthSerializer, LicenseSerializer
84

95
from codecov_auth.models import (
106
GithubAppInstallation,
117
Owner,
128
)
9+
from graphql_api.types.owner.owner import AI_FEATURES_GH_APP_ID
10+
11+
from .serializers import GenAIAuthSerializer
12+
1313

1414
class GenAIAuthView(APIView):
1515
permission_classes = [IsAuthenticated]
@@ -27,7 +27,7 @@ def get(self, request, *args, **kwargs):
2727
).first()
2828

2929
if ai_features_app_install and ai_features_app_install.repository_service_ids:
30-
repos = ai_features_app_install.repository_service_ids
30+
repos = ai_features_app_install.repository_service_ids
3131

3232
data = {
3333
"is_valid": bool(ai_features_app_install),

api/internal/tests/test_gen_ai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from rest_framework.reverse import reverse
22
from rest_framework.test import APITestCase
33
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
4-
from utils.test_utils import Client
4+
55
from codecov_auth.models import GithubAppInstallation
66
from graphql_api.types.owner.owner import AI_FEATURES_GH_APP_ID
7+
from utils.test_utils import Client
78

89

910
class GenAIAuthViewTests(APITestCase):

utils/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def app(self) -> str:
4545
migrate_to = None
4646

4747
def setUp(self) -> None:
48-
assert self.migrate_from and self.migrate_to, (
49-
"TestCase '{}' must define migrate_from and migrate_to properties".format(
50-
type(self).__name__
51-
)
48+
assert (
49+
self.migrate_from and self.migrate_to
50+
), "TestCase '{}' must define migrate_from and migrate_to properties".format(
51+
type(self).__name__
5252
)
5353
self.migrate_from = [(self.app, self.migrate_from)]
5454
self.migrate_to = [(self.app, self.migrate_to)]

0 commit comments

Comments
 (0)