Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update API usage notifications thresholds #4255

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/organisations/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
API_USAGE_ALERT_THRESHOLDS = [75, 90, 100, 120]
API_USAGE_ALERT_THRESHOLDS = [75, 90, 100, 120, 200, 300, 400, 500]
API_USAGE_GRACE_PERIOD = 7
ALERT_EMAIL_MESSAGE = (
"Organisation %s has used %d seats which is over their plan limit of %d (plan: %s)"
Expand Down
19 changes: 19 additions & 0 deletions api/organisations/migrations/0055_alter_percent_usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.25 on 2024-06-26 18:11

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('organisations', '0054_create_api_billing'),
]

operations = [
migrations.AlterField(
model_name='organisationapiusagenotification',
name='percent_usage',
field=models.IntegerField(validators=[django.core.validators.MinValueValidator(75), django.core.validators.MaxValueValidator(500)]),
),
]
2 changes: 1 addition & 1 deletion api/organisations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class OrganisationAPIUsageNotification(models.Model):
)
percent_usage = models.IntegerField(
null=False,
validators=[MinValueValidator(75), MaxValueValidator(120)],
validators=[MinValueValidator(75), MaxValueValidator(500)],
)
notified_at = models.DateTimeField(null=True)

Expand Down
Loading