From 9ee5c661b0734007da08ec712ff32988f4e0d0d4 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Thu, 8 Sep 2016 09:21:32 +0100 Subject: [PATCH] Changed as per @chs comment. Using cls based not explicity calling type --- app/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index 16ac0279a..91294c15d 100644 --- a/app/models.py +++ b/app/models.py @@ -480,8 +480,9 @@ class Notification(db.Model): if personalisation: self._personalisation = encryption.encrypt(personalisation) - @staticmethod + @classmethod def from_api_request( + cls, created_at, notification, notification_id, @@ -489,7 +490,7 @@ class Notification(db.Model): notification_type, api_key_id, key_type): - return Notification( + return cls( id=notification_id, template_id=notification['template'], template_version=notification['template_version'],