bytes can not be serialized to json
This commit is contained in:
parent
5cd43be8c4
commit
38a0431fe0
1 changed files with 4 additions and 1 deletions
|
@ -126,7 +126,10 @@ class Changelog(db.Model):
|
|||
|
||||
def json(self):
|
||||
timestamp = self.timestamp or datetime2ts(self.created)
|
||||
return [self.revision, timestamp, self.sig, self.data]
|
||||
sig = self.sig
|
||||
if isinstance(sig, bytes):
|
||||
sig = sig.decode()
|
||||
return [self.revision, timestamp, sig, self.data]
|
||||
|
||||
@classmethod
|
||||
def restore(cls, user_id, path=None):
|
||||
|
|
Loading…
Reference in a new issue