Remove from_request method on the Notification db model, was not needed anymore.

Use Notifications.query.one(), rather than assert count is 1 and query for all and get first item in list.
This commit is contained in:
Rebecca Law
2016-11-14 14:41:32 +00:00
parent 4379308189
commit c00eb0f5a4
4 changed files with 13 additions and 112 deletions

View File

@@ -537,34 +537,6 @@ class Notification(db.Model):
if personalisation:
self._personalisation = encryption.encrypt(personalisation)
@classmethod
def from_request(cls,
template_id,
template_version,
recipient,
service_id,
personalisation,
notification_type,
api_key_id,
key_type,
job_id,
job_row_number,
created_at):
return cls(
template_id=template_id,
template_version=template_version,
to=recipient,
service_id=service_id,
status='created',
created_at=created_at,
personalisation=personalisation,
notification_type=notification_type,
api_key_id=api_key_id,
key_type=key_type,
job_id=job_id,
job_row_number=job_row_number
)
class NotificationHistory(db.Model):
__tablename__ = 'notification_history'