Skip to content

Commit 75e9d85

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3f397cd commit 75e9d85

174 files changed

Lines changed: 190 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/account_v2/custom_auth_middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from backend.constants import RequestHeader
2+
from backend.internal_api_constants import INTERNAL_API_PREFIX
13
from django.conf import settings
24
from django.http import HttpRequest, HttpResponse, JsonResponse
35
from utils.constants import Account
@@ -7,8 +9,6 @@
79
from account_v2.authentication_plugin_registry import AuthenticationPluginRegistry
810
from account_v2.authentication_service import AuthenticationService
911
from account_v2.constants import Common
10-
from backend.constants import RequestHeader
11-
from backend.internal_api_constants import INTERNAL_API_PREFIX
1212

1313

1414
class CustomAuthMiddleware:

backend/account_v2/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import uuid
22

3+
from backend.constants import FieldLengthConstants as FieldLength
34
from django.contrib.auth.models import AbstractUser, Group, Permission
45
from django.db import models
56

6-
from backend.constants import FieldLengthConstants as FieldLength
7-
87
NAME_SIZE = 64
98
KEY_SIZE = 64
109

backend/adapter_processor_v2/adapter_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from django.core.exceptions import ObjectDoesNotExist
99
from platform_settings_v2.platform_auth_service import PlatformAuthenticationService
1010
from tenant_account_v2.organization_member_service import OrganizationMemberService
11+
from unstract.flags.feature_flag import check_feature_flag_status
1112

1213
from adapter_processor_v2.constants import AdapterKeys, AllowedDomains
1314
from adapter_processor_v2.exceptions import (
@@ -16,7 +17,6 @@
1617
InValidAdapterId,
1718
TestAdapterError,
1819
)
19-
from unstract.flags.feature_flag import check_feature_flag_status
2020

2121
if check_feature_flag_status("sdk1"):
2222
from unstract.sdk1.adapters.adapterkit import Adapterkit

backend/adapter_processor_v2/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from rest_framework.exceptions import APIException
2+
from unstract.flags.feature_flag import check_feature_flag_status
23

34
from adapter_processor_v2.constants import AdapterKeys
4-
from unstract.flags.feature_flag import check_feature_flag_status
55

66
if check_feature_flag_status("sdk1"):
77
from unstract.sdk1.exceptions import SdkError

backend/adapter_processor_v2/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
from django.db import models
1010
from django.db.models import QuerySet
1111
from tenant_account_v2.models import OrganizationMember
12+
from unstract.flags.feature_flag import check_feature_flag_status
1213
from utils.exceptions import InvalidEncryptionKey
1314
from utils.models.base_model import BaseModel
1415
from utils.models.organization_mixin import (
1516
DefaultOrganizationManagerMixin,
1617
DefaultOrganizationMixin,
1718
)
1819

19-
from unstract.flags.feature_flag import check_feature_flag_status
20-
2120
if check_feature_flag_status("sdk1"):
2221
from unstract.sdk1.adapters.adapterkit import Adapterkit
2322
from unstract.sdk1.constants import AdapterTypes

backend/adapter_processor_v2/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
from typing import Any
33

44
from account_v2.serializer import UserSerializer
5+
from backend.constants import FieldLengthConstants as FLC
6+
from backend.serializers import AuditSerializer
57
from cryptography.fernet import Fernet
68
from django.conf import settings
79
from rest_framework import serializers
810
from rest_framework.serializers import ModelSerializer
11+
from unstract.flags.feature_flag import check_feature_flag_status
912

1013
from adapter_processor_v2.adapter_processor import AdapterProcessor
1114
from adapter_processor_v2.constants import AdapterKeys
12-
from backend.constants import FieldLengthConstants as FLC
13-
from backend.serializers import AuditSerializer
14-
from unstract.flags.feature_flag import check_feature_flag_status
1515

1616
if check_feature_flag_status("sdk1"):
1717
from unstract.sdk1.constants import AdapterTypes

backend/api_v2/management/commands/delete_org_rate_limit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def handle(self, *args, **options):
8686
try:
8787
usage = APIDeploymentRateLimiter.get_current_usage(organization)
8888
self.stdout.write(
89-
f'\nCurrent usage: {usage["org_count"]}/{default_limit} concurrent requests'
89+
f"\nCurrent usage: {usage['org_count']}/{default_limit} concurrent requests"
9090
)
9191

9292
if usage["org_count"] >= default_limit:

backend/api_v2/management/commands/get_org_rate_limit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def handle(self, *args, **options):
6565

6666
self.stdout.write("\n--- Current Usage ---")
6767
self.stdout.write(
68-
f'Organization: {usage["org_count"]}/{usage["org_limit"]} concurrent requests'
68+
f"Organization: {usage['org_count']}/{usage['org_limit']} concurrent requests"
6969
)
7070
self.stdout.write(
71-
f'Global System: {usage["global_count"]}/{usage["global_limit"]} concurrent requests'
71+
f"Global System: {usage['global_count']}/{usage['global_limit']} concurrent requests"
7272
)
7373

7474
# Usage percentage

backend/api_v2/management/commands/list_org_rate_limits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def handle(self, *args, **options):
3737
usage = APIDeploymentRateLimiter.get_current_usage(org)
3838
pct = (usage["org_count"] / limit * 100) if limit > 0 else 0
3939
self.stdout.write(
40-
f' Usage: {usage["org_count"]}/{limit} ({pct:.1f}%)'
40+
f" Usage: {usage['org_count']}/{limit} ({pct:.1f}%)"
4141
)
4242
except Exception as e:
4343
self.stdout.write(f" Usage: Error - {e}")

backend/api_v2/management/commands/set_org_rate_limit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def handle(self, *args, **options):
5555
usage = APIDeploymentRateLimiter.get_current_usage(organization)
5656
self.stdout.write(
5757
self.style.WARNING(
58-
f'Current usage: {usage["org_count"]}/{limit} concurrent requests'
58+
f"Current usage: {usage['org_count']}/{limit} concurrent requests"
5959
)
6060
)
6161

0 commit comments

Comments
 (0)