Merge branch 'master' into updating-service_sms_senders

This commit is contained in:
Rebecca Law
2017-09-12 12:11:38 +01:00
11 changed files with 32 additions and 161 deletions

View File

@@ -16,7 +16,7 @@ class Encryption:
def hashpw(password):
return generate_password_hash(password.encode('UTF-8'), 10)
return generate_password_hash(password.encode('UTF-8'), 10).decode('utf-8')
def check_hash(password, hashed_password):

View File

@@ -1337,7 +1337,7 @@ class ServiceEmailReplyTo(db.Model):
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), unique=False, index=True, nullable=False)
service = db.relationship(Service, backref=db.backref("reply_to_email_addresses", uselist=False))
service = db.relationship(Service, backref=db.backref("reply_to_email_addresses"))
email_address = db.Column(db.Text, nullable=False, index=False, unique=False)
is_default = db.Column(db.Boolean, nullable=False, default=True)

View File

@@ -203,7 +203,8 @@ class ServiceSchema(BaseSchema):
'service_provider_stats',
'service_notification_stats',
'service_sms_senders',
'monthly_billing'
'monthly_billing',
'reply_to_email_addresses',
)
strict = True
@@ -256,7 +257,8 @@ class DetailedServiceSchema(BaseSchema):
'service_notification_stats',
'organisation',
'service_sms_senders',
'monthly_billing'
'monthly_billing',
'reply_to_email_addresses'
)

View File

@@ -177,7 +177,7 @@ email_content = {
post_email_response = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST sms notification response schema",
"description": "POST email notification response schema",
"type": "object",
"title": "response v2/notifications/email",
"properties": {

View File

@@ -88,7 +88,7 @@ def post_notification(notification_type):
create_resp_partial = functools.partial(
create_post_email_response_from_notification,
subject=template_with_content.subject,
email_from=authenticated_service.email_from
email_from='{}@{}'.format(authenticated_service.email_from, current_app.config['NOTIFY_EMAIL_DOMAIN'])
)
elif notification_type == LETTER_TYPE:
create_resp_partial = functools.partial(