Skip to content

Commit

Permalink
undo backend changes, might not be needed at all
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Nov 24, 2024
1 parent df6cc30 commit a637a74
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions backend/btrixcloud/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,6 @@ class S3Storage(BaseModel):

PAUSED_PAYMENT_FAILED = "paused_payment_failed"
ACTIVE = "active"
TRIALING = "trialing"

REASON_PAUSED = "subscriptionPaused"
REASON_CANCELED = "subscriptionCanceled"
Expand Down Expand Up @@ -1232,8 +1231,6 @@ class SubscriptionCreate(BaseModel):
planId: str

firstAdminInviteEmail: EmailStr

futureCancelDate: Optional[datetime] = None
quotas: Optional[OrgQuotas] = None


Expand Down
3 changes: 1 addition & 2 deletions backend/btrixcloud/orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
PAUSED_PAYMENT_FAILED,
REASON_PAUSED,
ACTIVE,
TRIALING,
DeletedResponse,
UpdatedResponse,
AddedResponse,
Expand Down Expand Up @@ -479,7 +478,7 @@ async def update_subscription_data(
if update.status == PAUSED_PAYMENT_FAILED:
query["readOnly"] = True
query["readOnlyReason"] = REASON_PAUSED
elif update.status in (ACTIVE, TRIALING):
elif update.status == ACTIVE:
query["readOnly"] = False
query["readOnlyReason"] = ""

Expand Down
9 changes: 2 additions & 7 deletions backend/btrixcloud/subs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ async def create_new_subscription(
) -> dict[str, Any]:
"""create org for new subscription"""
subscription = Subscription(
subId=create.subId,
status=create.status,
planId=create.planId,
futureCancelDate=create.futureCancelDate,
subId=create.subId, status=create.status, planId=create.planId
)

new_org = await self.org_ops.create_org(
Expand Down Expand Up @@ -98,9 +95,7 @@ async def import_subscription(
) -> dict[str, Any]:
"""import subscription to existing org"""
subscription = Subscription(
subId=sub_import.subId,
status=sub_import.status,
planId=sub_import.planId,
subId=sub_import.subId, status=sub_import.status, planId=sub_import.planId
)
await self.org_ops.add_subscription_to_org(subscription, sub_import.oid)

Expand Down
5 changes: 0 additions & 5 deletions backend/test/test_org_subs.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ def test_subscription_events_log(admin_auth_headers, non_default_org_id):
"status": "active",
"planId": "basic",
"firstAdminInviteEmail": "[email protected]",
"futureCancelDate": None,
"quotas": {
"maxConcurrentCrawls": 1,
"maxPagesPerCrawl": 100,
Expand All @@ -455,7 +454,6 @@ def test_subscription_events_log(admin_auth_headers, non_default_org_id):
"status": "active",
"planId": "basic",
"firstAdminInviteEmail": "[email protected]",
"futureCancelDate": None,
"quotas": {
"maxConcurrentCrawls": 1,
"maxPagesPerCrawl": 100,
Expand Down Expand Up @@ -524,7 +522,6 @@ def test_subscription_events_log_filter_sub_id(admin_auth_headers):
"status": "active",
"planId": "basic",
"firstAdminInviteEmail": "[email protected]",
"futureCancelDate": None,
"quotas": {
"maxConcurrentCrawls": 1,
"maxPagesPerCrawl": 100,
Expand Down Expand Up @@ -586,7 +583,6 @@ def test_subscription_events_log_filter_oid(admin_auth_headers):
"status": "active",
"planId": "basic",
"firstAdminInviteEmail": "[email protected]",
"futureCancelDate": None,
"quotas": {
"maxConcurrentCrawls": 1,
"maxPagesPerCrawl": 100,
Expand Down Expand Up @@ -682,7 +678,6 @@ def test_subscription_events_log_filter_status(admin_auth_headers):
"status": "active",
"planId": "basic",
"firstAdminInviteEmail": "[email protected]",
"futureCancelDate": None,
"quotas": {
"maxConcurrentCrawls": 1,
"maxPagesPerCrawl": 100,
Expand Down

0 comments on commit a637a74

Please sign in to comment.