aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-12-02 18:18:05 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-12-02 18:18:07 -0800
commitec7c7b14727285bc791a17d0e55529580283c73f (patch)
tree96fd956dc1995e98958b528403b5548cc8278a17
parent03d699531c3197f06bbea46a2be19d0307449034 (diff)
downloadfatcat-ec7c7b14727285bc791a17d0e55529580283c73f.tar.gz
fatcat-ec7c7b14727285bc791a17d0e55529580283c73f.zip
make file edit form hash values case insensitive
Test in previous commit. This fixes a user-reported 500 error when creating a file with SHA1/SHA256/MD5 hashes in upper-case.
-rw-r--r--python/fatcat_web/forms.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/fatcat_web/forms.py b/python/fatcat_web/forms.py
index b3073fb9..206c5087 100644
--- a/python/fatcat_web/forms.py
+++ b/python/fatcat_web/forms.py
@@ -344,6 +344,9 @@ class FileEntityForm(EntityEditForm):
"""
for simple_attr in FILE_SIMPLE_ATTRS:
a = getattr(self, simple_attr).data
+ # be flexible about hash capitalization
+ if simple_attr in ('md5', 'sha1', 'sha256'):
+ a = a.lower()
# special case blank strings
if a == '':
a = None