Skip to content

Commit

Permalink
Avoid showing messages twice #4380
Browse files Browse the repository at this point in the history
  • Loading branch information
joemull committed Nov 20, 2024
1 parent 829369d commit 6efcba8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/templates/admin/core/accounts/edit_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,10 @@ <h3>{% trans 'Profile Details' %}</h3>
});
</script>
{% endblock %}

{% block toastr %}
{% comment %}
Avoid showing the messages via Toastr since they should be included at the
top of the form.
{% endcomment %}
{% endblock toastr %}
8 changes: 5 additions & 3 deletions src/templates/admin/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ <h1>{% block title-section %}{% endblock %}</h1>
<script src="{% static "common/js/tinymce/tinymce.min.js" %}"></script>
{% endif %}
<script src="{% static "django_tinymce/init_tinymce.js" %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script>
{% block toastr %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script>
toastr.options = {
"closeButton": true,
"debug": true,
Expand Down Expand Up @@ -128,7 +129,8 @@ <h1>{% block title-section %}{% endblock %}</h1>
toastr.success("{{ message|linebreaksbr }}")
{% endif %}
{% endfor %}
</script>
</script>
{% endblock toastr %}

{% block js %}{% endblock %}
</body>
Expand Down
7 changes: 7 additions & 0 deletions src/templates/admin/core/large_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@
</div>
</div>
{% endblock body %}

{% block toastr %}
{% comment %}
Avoid showing the messages via Toastr since they should be included at the
top of the form.
{% endcomment %}
{% endblock toastr %}
7 changes: 7 additions & 0 deletions src/templates/admin/core/small_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
</div>
</div>
{% endblock body %}

{% block toastr %}
{% comment %}
Avoid showing the messages via Toastr since they should be included at the
top of the form.
{% endcomment %}
{% endblock toastr %}

0 comments on commit 6efcba8

Please sign in to comment.