mirror of
https://github.com/bitwarden/server.git
synced 2025-05-23 20:41:04 -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)
|
||||
{
|
||||
model.Seats = 2;
|
||||
model.MaxCollections = 2;
|
||||
TempData["Error"] = "Organizations with more than 2 seats cannot be downgraded to the Free plan";
|
||||
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.ExpirationDate = null;
|
||||
model.Enabled = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user