mirror of
https://github.com/bitwarden/server.git
synced 2025-05-23 04:21:05 -05:00
Resolve the pr comment
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
parent
9ad24079e6
commit
b63055cc6a
@ -255,16 +255,16 @@ public class OrganizationsController : Controller
|
|||||||
Seats = organization.Seats
|
Seats = organization.Seats
|
||||||
};
|
};
|
||||||
|
|
||||||
var plan = await _pricingClient.GetPlanOrThrow(model.PlanType.Value);
|
var freePlan = await _pricingClient.GetPlanOrThrow(model.PlanType.Value);
|
||||||
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.Seats > plan.PasswordManager.MaxSeats)
|
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.Seats > freePlan.PasswordManager.MaxSeats)
|
||||||
{
|
{
|
||||||
TempData["Error"] = $"Organizations with more than {plan.PasswordManager.MaxSeats} seats cannot be downgraded to the Free plan";
|
TempData["Error"] = $"Organizations with more than {freePlan.PasswordManager.MaxSeats} seats cannot be downgraded to the Free plan";
|
||||||
return RedirectToAction("Edit", new { id });
|
return RedirectToAction("Edit", new { id });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.MaxCollections > plan.PasswordManager.MaxCollections)
|
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.MaxCollections > freePlan.PasswordManager.MaxCollections)
|
||||||
{
|
{
|
||||||
TempData["Error"] = $"Organizations with more than {plan.PasswordManager.MaxCollections} collections cannot be downgraded to the Free plan. Your organization currently has {organization.MaxCollections} collections.";
|
TempData["Error"] = $"Organizations with more than {freePlan.PasswordManager.MaxCollections} collections cannot be downgraded to the Free plan. Your organization currently has {organization.MaxCollections} collections.";
|
||||||
return RedirectToAction("Edit", new { id });
|
return RedirectToAction("Edit", new { id });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ public class OrganizationsController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateOrganization(organization, model);
|
UpdateOrganization(organization, model);
|
||||||
|
var plan = await _pricingClient.GetPlanOrThrow(organization.PlanType);
|
||||||
if (organization.UseSecretsManager && !plan.SupportsSecretsManager)
|
if (organization.UseSecretsManager && !plan.SupportsSecretsManager)
|
||||||
{
|
{
|
||||||
TempData["Error"] = "Plan does not support Secrets Manager";
|
TempData["Error"] = "Plan does not support Secrets Manager";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user