mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
Set free_sms_fragment_limit when creating a service
The free_sms_fragment_limit of a service is set when the service is created. If a value for the free_sms_fragment_limit is not given, the default value is used.
This commit is contained in:
@@ -138,6 +138,10 @@ def create_service():
|
||||
errors = {'user_id': ['Missing data for required field.']}
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
|
||||
# TODO: to be removed when front-end is updated
|
||||
if 'free_sms_fragment_limit' not in data:
|
||||
data['free_sms_fragment_limit'] = current_app.config['FREE_SMS_TIER_FRAGMENT_COUNT']
|
||||
|
||||
# validate json with marshmallow
|
||||
service_schema.load(request.get_json())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user