Skip to content

Commit

Permalink
use python builtin hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho committed Dec 16, 2024
1 parent 8c07782 commit 5ba307e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Products/zms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def initialize(context):
# a. write it into separate file and
# b. create a configuration parameter
min_fileobj = open(fileobj.name, 'r')
min_hash = standard.encrypt_password(min_fileobj.read(),hex=True)
min_fileobj_content = min_fileobj.read()
min_hash = str(hash(min_fileobj_content))
min_hash_fileobj = open(fileobj.name + '.hash', 'w')
min_hash_fileobj.write(min_hash)
OFS.misc_.misc_.zms['confdict']['js_min.hash'] = min_hash
Expand Down
2 changes: 1 addition & 1 deletion Products/zms/zpt/common/zmi_html_head.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script type="text/javascript" charset="UTF-8" tal:attributes="src python:'/++resource++zms_/i18n/%s.js'%here.get_manage_lang()"></script>
<tal:block tal:repeat="src python:list(zmi_paths['js_paths'])+[here.getConfProperty(x) for x in here.getConfProperty('bootstrap.libs').split(',')]"
><script type="text/javascript" charset="UTF-8" tal:condition="src"
tal:attributes="src python:src.endswith('-all.min.js') and '%s?cache=%s'%(src,here.getConfProperty('js_min.hash')) or src">
tal:attributes="src python:src.endswith('-all.min.js') and '%s?hash=%s'%(src,here.getConfProperty('js_min.hash')) or src">
</script>
</tal:block>
<script tal:condition="python:here.restrictedTraverse(zmi_js, None)" tal:attributes="src zmi_js" type="text/javascript" charset="UTF-8" defer="defer"></script>
Expand Down

0 comments on commit 5ba307e

Please sign in to comment.