Removed contented updates the notifications stats table

- As before this is now driven from the notifications history table

- Removed from updates and create
- Signatures changes to removed unused params hits many files
- Also potential issue around rate limiting - we used to get the number sent per day from the stats table - which was a single row lookup, now we have to count this. This applies to EVERY API CALL. Probably not a good thing and should be addressed urgently.
This commit is contained in:
Martyn Inglis
2016-08-25 11:55:38 +01:00
parent 708f566c24
commit 893164ae40
12 changed files with 72 additions and 351 deletions

View File

@@ -491,7 +491,9 @@ class NotificationHistory(db.Model):
@classmethod
def from_notification(cls, notification):
return cls(**{c.name: getattr(notification, c.name) for c in cls.__table__.columns})
history = cls(**{c.name: getattr(notification, c.name) for c in cls.__table__.columns})
history.template = notification.template
return history
def update_from_notification(self, notification):
for c in self.__table__.columns: