mirror of
https://github.com/bitwarden/server.git
synced 2025-05-24 04:51:03 -05:00
Refactor the code base on the pr comment
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
parent
277f83f949
commit
45416c0534
@ -257,8 +257,18 @@ public class OrganizationsController : Controller
|
|||||||
|
|
||||||
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.Seats > 2)
|
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.Seats > 2)
|
||||||
{
|
{
|
||||||
model.Seats = 2;
|
TempData["Error"] = "Organizations with more than 2 seats cannot be downgraded to the Free plan";
|
||||||
model.MaxCollections = 2;
|
return RedirectToAction("Edit", new { id });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free && model.MaxCollections > 2)
|
||||||
|
{
|
||||||
|
TempData["Error"] = $"Organizations with more than 2 collections cannot be downgraded to the Free plan. Your organization currently has {organization.MaxCollections} collections.";
|
||||||
|
return RedirectToAction("Edit", new { id });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (organization.PlanType != PlanType.Free && model.PlanType == PlanType.Free)
|
||||||
|
{
|
||||||
model.MaxStorageGb = null;
|
model.MaxStorageGb = null;
|
||||||
model.ExpirationDate = null;
|
model.ExpirationDate = null;
|
||||||
model.Enabled = true;
|
model.Enabled = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user