Skip to content
Snippets Groups Projects
Commit 13c02d65 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Add missing data.id check for delete button (fixes server error for...

Add missing data.id check for delete button (fixes server error for users/editors when adding new datasets)
parent f68517ec
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Added a check to ensure `data.id` is present before rendering the delete button in the dataset edit form. This prevents server errors when `data.id` is not available, e.g., for new datasets.
## [2.4.2] - 2024-06-21
### Fixed
......
......@@ -26,7 +26,7 @@
<div class="form-actions">
<div class="row-fluid">
<div class="span6">
{% if h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %}
{% if data.id and h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %}
<a class="btn btn-danger pull-left" href="{% url_for 'dataset.delete', id=data.id %}"
data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this dataset?') }}">
{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment