misc: add hash to godo.js URI (#61448)

This commit is contained in:
Frédéric Péters 2022-02-04 16:38:45 +01:00
parent b2ad2f3641
commit 277415b4b3
2 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
import hashlib
from quixote import get_publisher, get_request, get_response, get_session
@ -28,6 +30,8 @@ def publisher(request):
if request.path.startswith('/backoffice/'):
template_base = 'wcs/blank.html'
from wcs.qommon.admin.menu import get_vc_version
return {
'publisher': get_publisher,
'response': get_response,
@ -35,4 +39,5 @@ def publisher(request):
'template_base': template_base,
'global_context': get_global_context,
'session_message': lambda: get_session() and get_session().display_message(),
'version_hash': hashlib.md5(str(get_vc_version()).encode()).hexdigest(),
}

View File

@ -4,7 +4,7 @@
{% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
class="mini-rich-text">{{widget.value|default:""}}</textarea>
<script type="module">
import Godo from "/static/xstatic/js/godo.js";
import Godo from "/static/xstatic/js/godo.js?{{version_hash}}";
new Godo(document.getElementById('form_{{widget.name}}'), {schema: 'basic'});
</script>
{% endblock %}