Subscription seat/unit update validation errors (NotASeatBasedSubscription, BelowMinimumSeats, AboveMaximumSeats, SeatsAlreadyAssigned, and the unit-based equivalents introduced in #13871) are plain SubscriptionError/PolarError subclasses returning a flat 400 response, unlike the rest of server/polar/subscription/service.py which uses PolarRequestValidationError for a structured 422 response.
Convert both the seats and units update validation paths (validate_seats_change, validate_units_change in server/polar/subscription/service.py) to raise PolarRequestValidationError instead, for consistency.
Raised from this discussion.
Sent by @frankie567 from PR #13871 dedicated issue creation.
Subscription seat/unit update validation errors (
NotASeatBasedSubscription,BelowMinimumSeats,AboveMaximumSeats,SeatsAlreadyAssigned, and the unit-based equivalents introduced in #13871) are plainSubscriptionError/PolarErrorsubclasses returning a flat 400 response, unlike the rest ofserver/polar/subscription/service.pywhich usesPolarRequestValidationErrorfor a structured 422 response.Convert both the seats and units update validation paths (
validate_seats_change,validate_units_changeinserver/polar/subscription/service.py) to raisePolarRequestValidationErrorinstead, for consistency.Raised from this discussion.
Sent by @frankie567 from PR #13871 dedicated issue creation.