#32718: [3.2.1] Issue with assigning file to FileField
-------------------------------------+-------------------------------------
Reporter: Jakub Kleň | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: 3.2.1 file model | Triage Stage: Accepted
filefield fieldfile |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Phillip Marshall):
Hi, I came across this as well. I had to makes like this one all over my
project to get things to work after the CV in 2.2.21.
{{{
merged_path = '/tmp/merged.png'
with open(img_path, mode='rb') as f:
- field.merged_map = ImageFile(f)
+ field.merged_map = ImageFile(f, name=os.path.basename(merged_path))
field.save()
}}}
This shouldn't have had to be the case, as the CV was about "empty file
names and paths with dot segments", and that doesn't apply in any of my
cases.
To me, it looks like Jakub's patch is sound and would solve this.
--
Ticket URL: <https://code.djangoproject.com/ticket/32718#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.d9740ea60ca5ce10e0439d5110804ef8%40djangoproject.com.