Skip to content

Commit 6ed0153

Browse files
committed
merge
2 parents 1935526 + 34cd095 commit 6ed0153

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/superannotate/lib/core/service_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class ErrorMessage(BaseModel):
1313

1414

1515
class Limit(BaseModel):
16-
max_image_count: int
16+
max_image_count: Optional[int]
1717
remaining_image_count: int
1818

1919

2020
class UserLimits(BaseModel):
21-
super_user_limit: Optional[Limit]
21+
user_limit: Optional[Limit]
2222
project_limit: Limit
2323
folder_limit: Limit
2424

src/superannotate/lib/core/usecases/images.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def _validate_limitations(self, to_upload_count):
234234
elif to_upload_count > response.data.project_limit.remaining_image_count:
235235
errors.append(constances.ATTACH_PROJECT_LIMIT_ERROR_MESSAGE)
236236
elif (
237-
response.data.super_user_limit
238-
and to_upload_count > response.data.super_user_limit.remaining_image_count
237+
response.data.user_limit
238+
and to_upload_count > response.data.user_limit.remaining_image_count
239239
):
240240
errors.append(constances.ATTACH_USER_LIMIT_ERROR_MESSAGE)
241241
if errors:
@@ -1151,8 +1151,8 @@ def validate_limitations(self):
11511151
elif response.data.project_limit.remaining_image_count < 1:
11521152
raise AppValidationException(constances.UPLOAD_PROJECT_LIMIT_ERROR_MESSAGE)
11531153
elif (
1154-
response.data.super_user_limit
1155-
and response.data.super_user_limit.remaining_image_count < 1
1154+
response.data.user_limit
1155+
and response.data.user_limit.remaining_image_count < 1
11561156
):
11571157
raise AppValidationException(constances.UPLOAD_USER_LIMIT_ERROR_MESSAGE)
11581158

@@ -1289,8 +1289,8 @@ def validate_limitations(self):
12891289
elif to_upload_count > response.data.project_limit.remaining_image_count:
12901290
raise AppValidationException(constances.UPLOAD_PROJECT_LIMIT_ERROR_MESSAGE)
12911291
elif (
1292-
response.data.super_user_limit
1293-
and to_upload_count > response.data.super_user_limit.remaining_image_count
1292+
response.data.user_limit
1293+
and to_upload_count > response.data.user_limit.remaining_image_count
12941294
):
12951295
raise AppValidationException(constances.UPLOAD_USER_LIMIT_ERROR_MESSAGE)
12961296

@@ -1626,8 +1626,8 @@ def validate_limitations(self):
16261626
elif to_upload_count > response.data.project_limit.remaining_image_count:
16271627
raise AppValidationException(constances.UPLOAD_PROJECT_LIMIT_ERROR_MESSAGE)
16281628
elif (
1629-
response.data.super_user_limit
1630-
and to_upload_count > response.data.super_user_limit.remaining_image_count
1629+
response.data.user_limit
1630+
and to_upload_count > response.data.user_limit.remaining_image_count
16311631
):
16321632
raise AppValidationException(constances.UPLOAD_USER_LIMIT_ERROR_MESSAGE)
16331633

@@ -1904,8 +1904,8 @@ def validate_limitations(self):
19041904
elif attachments_count > response.data.project_limit.remaining_image_count:
19051905
raise AppValidationException(constances.ATTACH_PROJECT_LIMIT_ERROR_MESSAGE)
19061906
elif (
1907-
response.data.super_user_limit
1908-
and attachments_count > response.data.super_user_limit.remaining_image_count
1907+
response.data.user_limit
1908+
and attachments_count > response.data.user_limit.remaining_image_count
19091909
):
19101910
raise AppValidationException(constances.ATTACH_USER_LIMIT_ERROR_MESSAGE)
19111911

@@ -2025,8 +2025,8 @@ def validate_limitations(self):
20252025
constances.COPY_PROJECT_LIMIT_ERROR_MESSAGE
20262026
)
20272027
if (
2028-
response.data.super_user_limit
2029-
and response.data.super_user_limit.remaining_image_count < 1
2028+
response.data.user_limit
2029+
and response.data.user_limit.remaining_image_count < 1
20302030
):
20312031
raise AppValidationException(constances.COPY_SUPER_LIMIT_ERROR_MESSAGE)
20322032

@@ -3568,8 +3568,8 @@ def validate_limitations(self):
35683568
elif not response.data.project_limit.remaining_image_count:
35693569
raise AppValidationException(constances.UPLOAD_PROJECT_LIMIT_ERROR_MESSAGE)
35703570
elif (
3571-
response.data.super_user_limit
3572-
and response.data.super_user_limit.remaining_image_count > 0
3571+
response.data.user_limit
3572+
and response.data.user_limit.remaining_image_count > 0
35733573
):
35743574
raise AppValidationException(constances.UPLOAD_USER_LIMIT_ERROR_MESSAGE)
35753575

0 commit comments

Comments
 (0)