flake8 - misc flake8 errs.

* unused variables
* variables in loops overshadowing imports
* excepts with no defined exc type (tried to avoid `except Exception` too)
* history mapper is still too complex
* default variables should never be mutable
This commit is contained in:
Leo Hemsted
2017-11-28 13:49:14 +00:00
parent 28d5f9b87f
commit 28088428f1
6 changed files with 14 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ from notifications_utils.recipients import (
validate_and_format_email_address
)
from notifications_utils.template import HTMLEmailTemplate, PlainTextEmailTemplate, SMSMessageTemplate
from requests.exceptions import HTTPError
from app import clients, statsd_client, create_uuid
from app.dao.notifications_dao import (
@@ -60,7 +61,7 @@ def send_sms_to_provider(notification):
update_notification(notification, provider)
try:
send_sms_response(provider.get_name(), str(notification.id), notification.to)
except:
except HTTPError:
# when we retry, we only do anything if the notification is in created - it's currently in sending,
# so set it back so that we actually attempt the callback again
notification.sent_at = None