Checking that the CI step fails

This commit is contained in:
Oliver Walters 2022-06-24 21:06:58 +10:00
parent cf52382b5e
commit ba2be0470d
2 changed files with 2 additions and 17 deletions

View File

@ -58,6 +58,8 @@ jobs:
- name: Lint Javascript Files
run: |
python InvenTree/manage.py prerender
echo "Checking translated javascript files:"
ls InvenTree/InvenTree/static_i18n/i18n/
npx eslint InvenTree/InvenTree/static_i18n/i18n/*.js
html:

View File

@ -8,8 +8,6 @@ from django import template
from django.template import TemplateSyntaxError
from django.templatetags.i18n import TranslateNode
import bleach
register = template.Library()
@ -21,21 +19,6 @@ class CustomTranslateNode(TranslateNode):
result = super().render(context)
result = bleach.clean(result)
# Remove any escape sequences
for seq in ['\a', '\b', '\f', '\n', '\r', '\t', '\v']:
result = result.replace(seq, '')
# Remove other disallowed characters
for c in ['\\', '`', ';', '|', '&']:
result = result.replace(c, '')
# Escape any quotes contained in the string
result = result.replace("'", r"\'")
result = result.replace('"', r'\"')
# Return the 'clean' resulting string
return result