Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit b77f1b7

Browse files
committed
fix a couple instances... still need to fix availablePlans
1 parent d34ea49 commit b77f1b7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/internal/owner/serializers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ def update(self, instance: Owner, validated_data: Dict[str, Any]) -> object:
331331
instance, desired_plan
332332
)
333333

334-
sentry_plans = Plan.objects.filter(tier=TierName.Sentry.value)
334+
sentry_plans = Plan.objects.filter(
335+
tier=TierName.SENTRY.value, is_active=True
336+
)
335337

336338
if desired_plan["value"] in sentry_plans:
337339
current_owner = self.context["view"].request.current_owner

codecov_auth/admin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,10 @@ class OwnerAdmin(AdminMixin, admin.ModelAdmin):
606606

607607
def get_form(self, request, obj=None, change=False, **kwargs):
608608
form = super().get_form(request, obj, change, **kwargs)
609-
PLANS_CHOICES = [(x, x) for x in Plan.objects.values_list("name", flat=True)]
609+
PLANS_CHOICES = [
610+
(x, x)
611+
for x in Plan.objects.filter(is_active=True).values_list("name", flat=True)
612+
]
610613
form.base_fields["plan"].widget = Select(
611614
choices=BLANK_CHOICE_DASH + PLANS_CHOICES
612615
)

0 commit comments

Comments
 (0)