Fix success_url for notes form

This commit is contained in:
Oliver Walters 2020-02-01 22:25:35 +11:00
parent f0933f216c
commit 88ec40e454
2 changed files with 7 additions and 2 deletions

View File

@ -15,9 +15,8 @@
<form method='POST'>
{% csrf_token %}
{{ form }}
<input type="submit" value='{% trans "Save Notes" %}'/>
{{ form }}
</form>
@ -40,6 +39,7 @@
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#edit-notes").click(function() {
location.href = "{% url 'part-notes' part.id %}?edit=1";

View File

@ -531,6 +531,11 @@ class PartNotes(UpdateView):
fields = ['notes']
def get_success_url(self):
""" Return the success URL for this form """
return reverse('part-notes', kwargs={'pk': self.get_object().id})
def get_context_data(self, **kwargs):
part = self.get_object()