notify-api-340 remove daily limit

This commit is contained in:
Kenneth Kehl
2023-07-11 12:37:27 -07:00
parent 5fe81bc040
commit c165589d4c
5 changed files with 6 additions and 22 deletions

View File

@@ -311,16 +311,6 @@ def init_app(application):
def _nav_selected():
return navigation
@application.context_processor
def _attach_current_daily_remaining_messages_per_service():
remaining_messages = 0
if hasattr(current_service, 'message_limit'):
remaining_messages = current_service.message_limit - service_api_client.get_notification_count(
service_id=current_service.id)
return {'daily_remaining_messages': remaining_messages}
@application.context_processor
def _attach_current_global_daily_messages():
remaining_global_messages = 0

View File

@@ -2,7 +2,6 @@ import json
from os import getenv
import newrelic.agent
from notifications_utils import DAILY_MESSAGE_LIMIT
from app.cloudfoundry_config import cloud_config
@@ -45,7 +44,7 @@ class Config(object):
DEFAULT_SERVICE_LIMIT = 50
GLOBAL_SERVICE_MESSAGE_LIMIT = DAILY_MESSAGE_LIMIT
GLOBAL_SERVICE_MESSAGE_LIMIT = 250000
EMAIL_EXPIRY_SECONDS = 3600 # 1 hour
INVITATION_EXPIRY_SECONDS = 3600 * 24 * 2 # 2 days - also set on api

View File

@@ -1,9 +1,6 @@
from datetime import datetime
from notifications_utils.clients.redis import (
daily_limit_cache_key,
daily_total_cache_key,
)
from notifications_utils.clients.redis import daily_total_cache_key
from app.extensions import redis_client
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
@@ -528,8 +525,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
return self.get("/service/{}/data-retention".format(service_id))
def get_notification_count(self, service_id):
# if cache is not set, or not enabled, return 0
count = redis_client.get(daily_limit_cache_key(service_id)) or 0
count = 0
return int(count)

View File

@@ -28,8 +28,6 @@
</ul>
</nav>
<div>
<p class="usa-body bold margin-bottom-1">Messages Left / Daily Limit</p>
<p>{{ daily_remaining_messages }} / {{ current_service.message_limit }}</p>
<p class="usa--body bold margin-bottom-1">Messages Left Across Services</p>
<p>{{ daily_global_messages_remaining }}</p>
</div>