Merge pull request #446 from alphagov/fix_link_bug

Updated notifications_utils version and associated code. Added email …
This commit is contained in:
NIcholas Staples
2016-04-14 12:06:55 +01:00
17 changed files with 35 additions and 23 deletions

View File

@@ -35,10 +35,10 @@ from app.notify_client.template_statistics_api_client import TemplateStatisticsA
from app.its_dangerous_session import ItsdangerousSessionInterface
from app.asset_fingerprinter import AssetFingerprinter
from utils.recipients import validate_phone_number, InvalidPhoneError
from notifications_utils.recipients import validate_phone_number, InvalidPhoneError
import app.proxy_fix
from config import configs
from utils import logging
from notifications_utils import logging
from werkzeug.local import LocalStack, LocalProxy
from flask.globals import _lookup_req_object
from functools import partial

View File

@@ -1,5 +1,5 @@
from flask_wtf import Form
from utils.recipients import (
from notifications_utils.recipients import (
validate_phone_number,
InvalidPhoneError
)

View File

@@ -2,7 +2,7 @@ import re
from wtforms import ValidationError
from datetime import datetime
from app.main.encryption import check_hash
from utils.template import Template
from notifications_utils.template import Template
class Blacklist(object):

View File

@@ -12,7 +12,7 @@ from flask import (
)
from flask_login import login_required
from werkzeug.datastructures import MultiDict
from utils.template import Template
from notifications_utils.template import Template
from app import (
job_api_client,

View File

@@ -11,7 +11,7 @@ from app import user_api_client
@main.route('/new-password/<path:token>', methods=['GET', 'POST'])
def new_password(token):
from utils.url_safe_token import check_token
from notifications_utils.url_safe_token import check_token
try:
token_data = check_token(token, current_app.config['SECRET_KEY'], current_app.config['DANGEROUS_SALT'],
current_app.config['TOKEN_MAX_AGE_SECONDS'])

View File

@@ -17,8 +17,8 @@ from flask import (
)
from flask_login import login_required, current_user
from utils.template import Template
from utils.recipients import RecipientCSV, first_column_heading, validate_and_format_phone_number
from notifications_utils.template import Template
from notifications_utils.recipients import RecipientCSV, first_column_heading, validate_and_format_phone_number
from app.main import main
from app.main.forms import CsvUploadForm

View File

@@ -1,7 +1,7 @@
from flask import render_template, current_app, abort
from flask_wtf import Form
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
from utils.template import Template
from notifications_utils.template import Template
from app.main import main

View File

@@ -1,7 +1,7 @@
from flask import request, render_template, redirect, url_for, flash, abort
from flask_login import login_required
from utils.template import Template
from notifications_utils.template import Template
from app.main import main
from app.utils import user_has_permissions

View File

@@ -15,6 +15,7 @@ from itsdangerous import SignatureExpired
from flask_login import login_user
from notifications_python_client.errors import HTTPError
from notifications_utils.url_safe_token import check_token
from app.main import main
from app.main.forms import TwoFactorForm
@@ -47,7 +48,6 @@ def verify():
@main.route('/verify-email/<token>')
def verify_email(token):
from utils.url_safe_token import check_token
try:
token_data = check_token(token,
current_app.config['SECRET_KEY'],

View File

@@ -46,7 +46,7 @@
{% if 'email' == template.template_type %}
{{ email_message(
template.subject,
template.formatted_subject_as_markup,
template.formatted_as_markup if errors else template.replaced,
from_address='{}@notifications.service.gov.uk'.format(current_service.email_from),
from_name=current_service.name

View File

@@ -23,7 +23,7 @@
</div>
{% elif 'email' == template.template_type %}
{{ email_message(
template.subject,
template.formatted_subject_as_markup,
template.formatted_as_markup,
from_address='{}@notifications.service.gov.uk'.format(current_service.email_from),
from_name=current_service.name

View File

@@ -21,7 +21,7 @@
</div>
{% elif 'email' == template.template_type %}
{{ email_message(
template.subject,
template.formatted_subject_as_markup,
template.formatted_as_markup,
from_address='{}@notifications.service.gov.uk'.format(current_service.email_from),
from_name=current_service.name