Skip to content

Commit

Permalink
Remove functionality for generic error
Browse files Browse the repository at this point in the history
This was added so the
"This destination cannot be deleted error" could be shown
separate from field specific errors, but after the changes
done to the delete endpoint this is no longer used.
_render_destination_list is complicated enough as-is that
removing this makes it a bit nicer
  • Loading branch information
stveit committed Jan 10, 2025
1 parent eec71cd commit a4325bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/argus/htmx/destination/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def _render_destination_list(
request,
create_form: Optional[DestinationFormCreate] = None,
update_forms: Optional[Sequence[DestinationFormUpdate]] = None,
errors: Optional[Sequence[str]] = None,
template: str = "htmx/destination/destination_list.html",
) -> HttpResponse:
"""Function to render the destinations page.
Expand All @@ -82,13 +81,10 @@ def _render_destination_list(
create_form = DestinationFormCreate()
if update_forms is None:
update_forms = _get_update_forms(request.user)
if errors is None:
errors = []
grouped_forms = _group_update_forms_by_media(update_forms)
context = {
"create_form": create_form,
"grouped_forms": grouped_forms,
"errors": errors,
}
return render(request, template, context=context)

Expand Down
1 change: 0 additions & 1 deletion src/argus/htmx/templates/htmx/destination/_content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div id="destination-content">
{% include "htmx/destination/_create_form.html" %}
{% for error in errors %}<p class="text-error">{{ error }}</p>{% endfor %}
{% include "htmx/destination/_form_list.html" %}
</div>

0 comments on commit a4325bf

Please sign in to comment.