billing: Fix exempt_from_from_license_number_check column name.

exempt_from_from_license_number_check was clearly not intended.
This commit is contained in:
Mateusz Mandera 2023-04-10 20:23:12 +02:00 committed by Tim Abbott
parent 2a45429a51
commit be208f73f7
3 changed files with 19 additions and 6 deletions

View File

@ -72,11 +72,7 @@ def check_spare_licenses_available_for_adding_new_users(
realm: Realm, extra_non_guests_count: int = 0, extra_guests_count: int = 0 realm: Realm, extra_non_guests_count: int = 0, extra_guests_count: int = 0
) -> None: ) -> None:
plan = get_current_plan_by_realm(realm) plan = get_current_plan_by_realm(realm)
if ( if plan is None or plan.automanage_licenses or plan.customer.exempt_from_license_number_check:
plan is None
or plan.automanage_licenses
or plan.customer.exempt_from_from_license_number_check
):
return return
if plan.licenses() < get_seat_count( if plan.licenses() < get_seat_count(

View File

@ -0,0 +1,17 @@
# Generated by Django 4.2 on 2023-04-10 18:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("corporate", "0016_customer_add_remote_server_field"),
]
operations = [
migrations.RenameField(
model_name="customer",
old_name="exempt_from_from_license_number_check",
new_name="exempt_from_license_number_check",
),
]

View File

@ -26,7 +26,7 @@ class Customer(models.Model):
# only for their paid employees. We don't prevent these # only for their paid employees. We don't prevent these
# organizations from adding more users than the number of licenses # organizations from adding more users than the number of licenses
# they purchased. # they purchased.
exempt_from_from_license_number_check = models.BooleanField(default=False) exempt_from_license_number_check = models.BooleanField(default=False)
def __str__(self) -> str: def __str__(self) -> str:
return f"{self.realm!r} {self.stripe_customer_id}" return f"{self.realm!r} {self.stripe_customer_id}"