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 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_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 builtins import str
|
||||
|
||||
import logging
|
||||
import smtplib
|
||||
@ -72,11 +73,11 @@ def send_notification(config, flats):
|
||||
website_url = config["website_url"]
|
||||
|
||||
for flat in flats:
|
||||
title = unicode(flat.title)
|
||||
flat_id = unicode(flat.id)
|
||||
area = unicode(flat.area)
|
||||
cost = unicode(flat.cost)
|
||||
currency = unicode(flat.currency)
|
||||
title = str(flat.title)
|
||||
flat_id = str(flat.id)
|
||||
area = str(flat.area)
|
||||
cost = str(flat.cost)
|
||||
currency = str(flat.currency)
|
||||
|
||||
txt += (
|
||||
'- {}: {}#/flat/{} (area: {}, cost: {} {})\n'.format(
|
||||
|
Loading…
Reference in New Issue
Block a user