From ec7c7b14727285bc791a17d0e55529580283c73f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 2 Dec 2019 18:18:05 -0800 Subject: 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. --- python/fatcat_web/forms.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python') 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 -- cgit v1.2.3