Skip to content

Commit

Permalink
server/subscriptions: improve typing compatability with pylance
Browse files Browse the repository at this point in the history
  • Loading branch information
zegl committed Nov 1, 2023
1 parent 91083a3 commit a8a2582
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions server/polar/subscription/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class SubscriptionTierCreate(Schema):
name: str = Field(
..., min_length=TIER_NAME_MIN_LENGTH, max_length=TIER_NAME_MAX_LENGTH
)
description: str | None = Field(None, max_length=TIER_DESCRIPTION_MAX_LENGTH)
description: str | None = Field(
default=None, max_length=TIER_DESCRIPTION_MAX_LENGTH
)
is_highlighted: bool = False
price_amount: int = Field(..., ge=0)
price_currency: str = Field("USD", regex="USD")
Expand Down Expand Up @@ -155,12 +157,14 @@ def check_either_organization_or_repository(

class SubscriptionTierUpdate(Schema):
name: str | None = Field(
None, min_length=TIER_NAME_MIN_LENGTH, max_length=TIER_NAME_MAX_LENGTH
default=None, min_length=TIER_NAME_MIN_LENGTH, max_length=TIER_NAME_MAX_LENGTH
)
description: str | None = Field(
default=None, max_length=TIER_DESCRIPTION_MAX_LENGTH
)
description: str | None = Field(None, max_length=TIER_DESCRIPTION_MAX_LENGTH)
is_highlighted: bool | None = None
price_amount: int | None = Field(None, ge=0)
price_currency: str | None = Field(None, regex="USD")
price_amount: int | None = Field(default=None, ge=0)
price_currency: str | None = Field(default=None, regex="USD")


class SubscriptionTierBenefitsUpdate(Schema):
Expand Down

2 comments on commit a8a2582

@vercel
Copy link

@vercel vercel bot commented on a8a2582 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on a8a2582 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-sigma-puce.vercel.app
docs-polar-sh.vercel.app
docs-git-main-polar-sh.vercel.app
docs.polar.sh

Please sign in to comment.