conditional encoding

This commit is contained in:
evilchili 2025-10-18 16:17:43 -07:00
parent 80a4fbd1f6
commit 972d42531c

View File

@ -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)