mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
pep8 fixes
no idea why the build/local pep8s weren't picking them up before. also excluded import order pep8
This commit is contained in:
@@ -113,7 +113,7 @@ def send_sms_to_provider(self, service_id, notification_id):
|
||||
def provider_to_use(notification_type, notification_id):
|
||||
active_providers_in_order = [
|
||||
provider for provider in get_provider_details_by_notification_type(notification_type) if provider.active
|
||||
]
|
||||
]
|
||||
|
||||
if not active_providers_in_order:
|
||||
current_app.logger.error(
|
||||
|
||||
@@ -87,7 +87,7 @@ def process_job(job_id):
|
||||
'personalisation': {
|
||||
key: personalisation.get(key)
|
||||
for key in template.placeholders
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if template.template_type == SMS_TYPE:
|
||||
|
||||
@@ -73,7 +73,7 @@ class MMGClient(SmsClient):
|
||||
"reqType": "BULK",
|
||||
"MSISDN": to,
|
||||
"msg": content,
|
||||
"sender": self.from_number if sender is None else sender,
|
||||
"sender": self.from_number if sender is None else sender,
|
||||
"cid": reference,
|
||||
"multi": multi
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ from app.models import (
|
||||
EMAIL_TYPE,
|
||||
NOTIFICATION_STATUS_TYPES_BILLABLE,
|
||||
KEY_TYPE_TEST
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def get_provider_statistics(service, **kwargs):
|
||||
|
||||
@@ -201,10 +201,10 @@ def create_history(obj, history_cls=None):
|
||||
# not yet have a value before insert
|
||||
|
||||
elif isinstance(prop, RelationshipProperty):
|
||||
if hasattr(history, prop.key+'_id'):
|
||||
if hasattr(history, prop.key + '_id'):
|
||||
foreign_obj = getattr(obj, prop.key)
|
||||
# if it's a nullable relationship, foreign_obj will be None, and we actually want to record that
|
||||
data[prop.key+'_id'] = getattr(foreign_obj, 'id', None)
|
||||
data[prop.key + '_id'] = getattr(foreign_obj, 'id', None)
|
||||
|
||||
if not obj.version:
|
||||
obj.version = 1
|
||||
|
||||
@@ -427,7 +427,7 @@ class NotificationsFilterSchema(ma.Schema):
|
||||
|
||||
class TemplateStatisticsSchema(BaseSchema):
|
||||
|
||||
template = fields.Nested(TemplateSchema, only=["id", "name", "template_type"], dump_only=True)
|
||||
template = fields.Nested(TemplateSchema, only=["id", "name", "template_type"], dump_only=True)
|
||||
|
||||
class Meta:
|
||||
model = models.TemplateStatistics
|
||||
|
||||
Reference in New Issue
Block a user