mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-27 15:54:16 +00:00
Allow user role to view history (#890)
This commit is contained in:
@@ -13,12 +13,16 @@ class History(db.Model):
|
||||
detail = db.Column(db.Text())
|
||||
created_by = db.Column(db.String(128))
|
||||
created_on = db.Column(db.DateTime, index=True, default=datetime.utcnow)
|
||||
domain_id = db.Column(db.Integer,
|
||||
db.ForeignKey('domain.id'),
|
||||
nullable=True)
|
||||
|
||||
def __init__(self, id=None, msg=None, detail=None, created_by=None):
|
||||
def __init__(self, id=None, msg=None, detail=None, created_by=None, domain_id=None):
|
||||
self.id = id
|
||||
self.msg = msg
|
||||
self.detail = detail
|
||||
self.created_by = created_by
|
||||
self.domain_id = domain_id
|
||||
|
||||
def __repr__(self):
|
||||
return '<History {0}>'.format(self.msg)
|
||||
@@ -31,6 +35,7 @@ class History(db.Model):
|
||||
h.msg = self.msg
|
||||
h.detail = self.detail
|
||||
h.created_by = self.created_by
|
||||
h.domain_id = self.domain_id
|
||||
db.session.add(h)
|
||||
db.session.commit()
|
||||
|
||||
|
Reference in New Issue
Block a user