Add additional tests and refactor

This commit is contained in:
Imdad Ahad
2016-10-28 10:47:32 +01:00
parent 5ecdbb8596
commit 2676ee9bcf
3 changed files with 43 additions and 35 deletions

View File

@@ -1,11 +1,9 @@
import re
from flask import (current_app, render_template, redirect, url_for, session)
from flask import (render_template, redirect, url_for, session)
from flask_login import login_required, current_user
from app.main import main
from app import service_api_client
from app.notify_client.service_api_client import ServicesBrowsableItem
from app.utils import user_in_whitelist
from app.utils import is_gov_user
@main.route("/services")
@@ -15,7 +13,7 @@ def choose_service():
'views/choose-service.html',
services=[ServicesBrowsableItem(x) for x in
service_api_client.get_services({'user_id': current_user.id})['data']],
can_add_service=user_in_whitelist(current_user.email_address)
can_add_service=is_gov_user(current_user.email_address)
)