Skip to content

Commit

Permalink
feat: Update API usage notifications thresholds (#4255)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan authored Jun 27, 2024
1 parent f095a50 commit 5162687
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
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

0 comments on commit 5162687

Please sign in to comment.