Skip to content

Commit

Permalink
Fix javascript and component template in prod environments (#3672)
Browse files Browse the repository at this point in the history
Co-authored-by: stephanie0x00 <[email protected]>
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 0f31898 commit 495522b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
Empty file added rocky/components/__init__.py
Empty file.
3 changes: 2 additions & 1 deletion rocky/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ override_dh_virtualenv:
&& $(DH_VENV_DIR)/bin/python manage.py collectstatic --noinput --clear \
&& $(DH_VENV_DIR)/bin/python manage.py compress \
&& $(DH_VENV_DIR)/bin/python manage.py compilemessages
find static -type f -exec install -D "{}" "$(DESTDIR)/usr/share/kat-rocky/{}" \;
find static -type f -exec install -m 644 -D "{}" "$(DESTDIR)/usr/share/kat-rocky/{}" \;
find components -type f -name *.html -exec install -m 644 -D "{}" "$(DH_VENV_DIR)/lib/`py3versions -d`/site-packages/{}" \;


# remove pip to prevent mutation of venv
Expand Down
4 changes: 1 addition & 3 deletions rocky/katalogus/templates/partials/plugin_tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,5 @@
{% endif %}
</div>
{% block html_at_end_body %}
{% compress js %}
<script src="{% static "modal/script.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
{% endcompress %}
<script src="{% static "modal/script.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
{% endblock html_at_end_body %}
6 changes: 2 additions & 4 deletions rocky/reports/templates/partials/export_report_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ <h3>{% translate "Recurrence" %}</h3>
</div>
</section>
{% block html_at_end_body %}
{% compress js %}
<script src="{% static "js/renameReports.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
<script src="{% static "js/autoSubmit.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
{% endcompress %}
<script src="{% static "js/renameReports.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
<script src="{% static "js/autoSubmit.js" %}" nonce="{{ request.csp_nonce }}" type="module"></script>
{% endblock html_at_end_body %}
2 changes: 1 addition & 1 deletion rocky/rocky/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def immutable_file_test(path, url):


WHITENOISE_IMMUTABLE_FILE_TEST = immutable_file_test
WHITENOISE_KEEP_ONLY_HASHED_FILES = True
WHITENOISE_KEEP_ONLY_HASHED_FILES = False

LOGIN_URL = "login"
LOGIN_REDIRECT_URL = "crisis_room"
Expand Down

0 comments on commit 495522b

Please sign in to comment.