Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Aug 31, 2021
1 parent 3f5cd0b commit ad12e58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-dev-5066-g6620ed10d (2021-08-28 12:48:49)
nursix-dev-5067-g3f5cd0bea (2021-08-31 13:54:08)
6 changes: 3 additions & 3 deletions modules/s3/s3validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ def validate(self, value, record_id=None):
# the update form.
# NOTE: A FieldStorage with data evaluates as False (odd!)
uploaded_image = post_vars.get(self.field_name)
if uploaded_image not in (b"", None): # Py 3.x it's b"", which is equivalent to "" in Py 2.x
if uploaded_image not in (b"", None):
return uploaded_image

cropped_image = post_vars.get("imagecrop-data")
Expand All @@ -1485,9 +1485,9 @@ def validate(self, value, record_id=None):
if cropped_image:
import base64

metadata, cropped_image = cropped_image.split(",")
metadata, cropped_image = cropped_image.rsplit(",", 1)
#filename, datatype, enctype = metadata.split(";")
filename = metadata.split(";", 1)[0]
filename = metadata.rsplit(";", 2)[0]

f = Storage()
f.filename = uuid4().hex + filename
Expand Down

0 comments on commit ad12e58

Please sign in to comment.