fix: seek uploaded file to start before saving to avoid empty image on commit
All checks were successful
Docker / build (release) Successful in 9s
All checks were successful
Docker / build (release) Successful in 9s
This commit is contained in:
parent
b121dc82e3
commit
b0027be96c
1 changed files with 1 additions and 0 deletions
|
|
@ -313,6 +313,7 @@ class GalleryUpload(PermissionRequiredMixin, FormView):
|
||||||
obj.save()
|
obj.save()
|
||||||
obj.galleries.set([gallery])
|
obj.galleries.set([gallery])
|
||||||
def _save(o=obj, fp=file_path, f=file_obj, ff=file_field, ps=post_save):
|
def _save(o=obj, fp=file_path, f=file_obj, ff=file_field, ps=post_save):
|
||||||
|
f.seek(0)
|
||||||
getattr(o, ff).save(fp, f)
|
getattr(o, ff).save(fp, f)
|
||||||
if ps:
|
if ps:
|
||||||
ps(o)
|
ps(o)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue