ensure created_by_id is being persisted correctly

(also make sure it's well tested 🎉 )
This commit is contained in:
Leo Hemsted
2017-06-23 15:56:47 +01:00
parent 1ba175f8a6
commit 350133e6db
3 changed files with 11 additions and 4 deletions

View File

@@ -1007,6 +1007,9 @@ class NotificationHistory(db.Model, HistoryModel):
phone_prefix = db.Column(db.String, nullable=True)
rate_multiplier = db.Column(db.Float(asdecimal=False), nullable=True)
created_by = db.relationship('User')
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), nullable=True)
@classmethod
def from_original(cls, notification):
history = super().from_original(notification)