mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Added current_service to flask context and template context.
Fix all tests and conflicts. Removed comment line.
This commit is contained in:
@@ -2,13 +2,14 @@ from flask import (
|
||||
render_template,
|
||||
session,
|
||||
flash,
|
||||
jsonify
|
||||
jsonify,
|
||||
request
|
||||
)
|
||||
from datetime import date
|
||||
|
||||
from flask_login import login_required
|
||||
from app.main import main
|
||||
from app import (job_api_client, statistics_api_client, service_api_client)
|
||||
from app import (job_api_client, statistics_api_client, service_api_client, current_service)
|
||||
from app.utils import user_has_permissions
|
||||
|
||||
|
||||
@@ -19,14 +20,10 @@ def service_dashboard(service_id):
|
||||
templates = service_api_client.get_service_templates(service_id)['data']
|
||||
jobs = job_api_client.get_job(service_id)['data']
|
||||
|
||||
service = service_api_client.get_service(service_id)
|
||||
session['service_name'] = service['data']['name']
|
||||
session['service_id'] = service['data']['id']
|
||||
|
||||
if session.get('invited_user'):
|
||||
session.pop('invited_user', None)
|
||||
service_name = service['data']['name']
|
||||
message = 'You have successfully accepted your invitation and been added to {}'.format(service_name)
|
||||
message = 'You have successfully accepted your invitation and been added to {}'.format(
|
||||
current_service['name'])
|
||||
flash(message, 'default_with_tick')
|
||||
|
||||
statistics = statistics_api_client.get_statistics_for_service(service_id)['data']
|
||||
@@ -37,7 +34,6 @@ def service_dashboard(service_id):
|
||||
more_jobs_to_show=(len(jobs) > 5),
|
||||
free_text_messages_remaining='250,000',
|
||||
spent_this_month='0.00',
|
||||
service=service['data'],
|
||||
statistics=add_rates_to(statistics),
|
||||
templates=templates,
|
||||
service_id=str(service_id))
|
||||
|
||||
Reference in New Issue
Block a user