conditional encoding
This commit is contained in:
+3
-1
@@ -304,7 +304,9 @@ class FilePointer(Field):
|
|||||||
relpath = self.relpath(record)
|
relpath = self.relpath(record)
|
||||||
path = db.path / relpath
|
path = db.path / relpath
|
||||||
path.parent.mkdir(parents=True, exist_ok=True)
|
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)
|
record[self.name] = str(relpath)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user