Allow a platform admin user to set flexible data retention for a service for a specified notification type.

Still a work in progress
This commit is contained in:
Rebecca Law
2018-07-13 16:47:26 +01:00
parent c4b5e0c4b6
commit 13d05c5461
4 changed files with 67 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ def service_settings(service_id):
)
free_sms_fragment_limit = billing_api_client.get_free_sms_fragment_limit_for_year(service_id)
data_retention = service_api_client.get_service_data_retention(service_id)
return render_template(
'views/service-settings.html',
@@ -104,6 +105,7 @@ def service_settings(service_id):
free_sms_fragment_limit=free_sms_fragment_limit,
prefix_sms=current_service['prefix_sms'],
organisation=organisation,
data_retention=data_retention,
)
@@ -1008,6 +1010,18 @@ def branding_request(service_id):
)
@main.route("/services/<service_id>/set-data-retention", methods=['GET', 'POST'])
@login_required
@user_is_platform_admin
def set_data_retention(service_id):
results = service_api_client.get_service_data_retention(service_id)
print("DATA RETENTION: ", results[0])
return render_template(
'views/service-settings/set-data-retention.html',
data_retentions=results
)
def get_branding_as_value_and_label(email_branding):
return [
(branding['id'], branding['name'])