[misc] Concat strings explicitly

This commit is contained in:
Martin Rey 2020-10-13 03:27:23 +02:00 committed by Maike
parent e85a4cebb0
commit 8705fe0b1f
2 changed files with 3 additions and 3 deletions

View file

@ -44,8 +44,8 @@ class EmailBot(Censor):
token = to_token(email=subscriber.email, hood=self.hood.id) token = to_token(email=subscriber.email, hood=self.hood.id)
body = ( body = (
'{0}\n\n--\n' '{0}\n\n--\n'
'If you want to stop receiving these mails,' + 'If you want to stop receiving these mails,'
'follow this link: {1}/hoods/{2}/email-unsubscribe?token={3}' + 'follow this link: {1}/hoods/{2}/email-unsubscribe?token={3}'
).format(message.text, config['frontend_url'], self.hood.id, token) ).format(message.text, config['frontend_url'], self.hood.id, token)
try: try:
logger.debug('Trying to send: \n{0}'.format(body)) logger.debug('Trying to send: \n{0}'.format(body))

View file

@ -20,7 +20,7 @@ def test_email_subscribe_unsubscribe(client, hood_id, receive_email):
body = mail['body'] body = mail['body']
confirm_url = findall( confirm_url = findall(
r'http[s]?://' r'http[s]?://'
r'(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', + r'(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',
body, body,
)[0] )[0]
start = len('token=') start = len('token=')