Django как удалить #modal из url
У меня есть модал для подтверждения действия и этот модал добавляет #modal в url, но после отправки url он остается в url даже после того, как я сделал редирект в views.py
<div class="wf-modal" aria-hidden="true" id="{{sepet.id}}">
<article class="wf-dialog-modal">
<form action="" method="post">
{% csrf_token %}
<div class="wf-content-modal">
<input type="hidden" name="cancel-id" value="{{sepet.id}}">
<label for="sebep">{%if sepet.siparis_durumu.durum == "Kargoya Verildi"%}İade{%else%}İptal{%endif%} Sebebi: </label>
<textarea name="sebep" style="resize: none; margin-left: 2px;" cols="40" rows="5" {%if sepet.siparis_durumu.durum == "Kargoya Verildi"%}required{%endif%}></textarea>
</div>
<footer class="wf-footer-modal">
<button name="gonder" value="gonder">Gönder</button>
<a href=""><button name="iptal" type="button">İptal</button></a>
</footer>
</form>
</article>
</div>
views.py
if req.get('gonder'):
if ...:
return redirect('/hesabim/iptal/')
но url по-прежнему выглядит как /hesabim/iptal/#modal-id
Я решил эту проблему с помощью js в зависимости от комментария @WillemVanOnsem, используя:
window.location.hash = '';