conditional encoding
This commit is contained in:
parent
80a4fbd1f6
commit
972d42531c
|
|
@ -304,7 +304,9 @@ class FilePointer(Field):
|
|||
relpath = self.relpath(record)
|
||||
path = db.path / relpath
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(record[self.name])
|
||||
path.write_bytes(
|
||||
record[self.name] if isinstance(record[self.name], FilePointer.value_type) else record[self.name].encode()
|
||||
)
|
||||
record[self.name] = str(relpath)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user