This commit is contained in:
parent
f1a5535bca
commit
c96b2a3f4c
@ -126,7 +126,7 @@ def validate_config(config, check_with_data):
|
|||||||
assert config["backends"] is None or isinstance(config["backends"], list) # noqa: E501
|
assert config["backends"] is None or isinstance(config["backends"], list) # noqa: E501
|
||||||
|
|
||||||
assert isinstance(config["send_email"], bool)
|
assert isinstance(config["send_email"], bool)
|
||||||
assert config["smtp_server"] is None or isinstance(config["smtp_server"], (str, unicode)) # noqa: E501
|
assert config["smtp_server"] is None or isinstance(config["smtp_server"], str) # noqa: E501
|
||||||
assert config["smtp_port"] is None or isinstance(config["smtp_port"], int) # noqa: E501
|
assert config["smtp_port"] is None or isinstance(config["smtp_port"], int) # noqa: E501
|
||||||
assert config["smtp_to"] is None or isinstance(config["smtp_to"], list)
|
assert config["smtp_to"] is None or isinstance(config["smtp_to"], list)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ Email notifications.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
from builtins import str
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import smtplib
|
import smtplib
|
||||||
@ -72,11 +73,11 @@ def send_notification(config, flats):
|
|||||||
website_url = config["website_url"]
|
website_url = config["website_url"]
|
||||||
|
|
||||||
for flat in flats:
|
for flat in flats:
|
||||||
title = unicode(flat.title)
|
title = str(flat.title)
|
||||||
flat_id = unicode(flat.id)
|
flat_id = str(flat.id)
|
||||||
area = unicode(flat.area)
|
area = str(flat.area)
|
||||||
cost = unicode(flat.cost)
|
cost = str(flat.cost)
|
||||||
currency = unicode(flat.currency)
|
currency = str(flat.currency)
|
||||||
|
|
||||||
txt += (
|
txt += (
|
||||||
'- {}: {}#/flat/{} (area: {}, cost: {} {})\n'.format(
|
'- {}: {}#/flat/{} (area: {}, cost: {} {})\n'.format(
|
||||||
|
Loading…
Reference in New Issue
Block a user