{% extends "base.html" %} {% load static %} {% block title %}Delete {{ object.name }} - Analytics Metrics{% endblock %} {% block content %}

Delete Metric Confirmation Required

Confirm Metric Deletion

Warning: Permanent Deletion

You are about to permanently delete an analytics metric. This action cannot be undone and will affect all historical data and dashboard displays.

Metric Details
Name: {{ object.name }}
Description: {{ object.description|default:"No description" }}
Category: {{ object.get_category_display }}
Current Value: {% if object.current_value is not None %} {{ object.current_value }}{% if object.unit %} {{ object.unit }}{% endif %} {% else %} No data {% endif %}
Status: {{ object.get_status_display }}
Metric Statistics
Created: {{ object.created_at|date:"M d, Y" }}
Created By: {{ object.created_by.get_full_name|default:"System" }}
Last Updated: {{ object.last_updated|date:"M d, Y H:i"|default:"Never" }}
Update Count: {{ object.update_count }}
Frequency: {{ object.get_update_frequency_display }}
Impact Assessment
  • Metric Definition: The metric configuration and calculation query will be permanently deleted
  • Historical Data: All {{ object.update_count }} historical data points will be removed
  • Dashboard Widgets: Any dashboard widgets displaying this metric will show no data
  • Reports: Reports referencing this metric may fail or show incomplete data
  • Alerts: Any alerts configured for this metric will be deactivated
  • Audit Trail: Deletion will be logged for compliance purposes
{% if object.target_value is not None %}
Target Configuration Warning

This metric has target configuration that will be lost:

  • Target Value: {{ object.target_value }}{% if object.unit %} {{ object.unit }}{% endif %}
  • Direction: {{ object.get_target_direction_display }}
  • {% if object.warning_threshold %}
  • Warning Threshold: {{ object.warning_threshold }}{% if object.unit %} {{ object.unit }}{% endif %}
  • {% endif %} {% if object.critical_threshold %}
  • Critical Threshold: {{ object.critical_threshold }}{% if object.unit %} {{ object.unit }}{% endif %}
  • {% endif %}
{% endif %}
{{ object.update_count }}
Data Points
{{ object.alert_count }}
Active Alerts
{{ object.dashboard_count }}
Dashboard Uses
{{ object.report_count }}
Report Uses
Alternative Actions

Consider these alternatives instead of deletion:

{% if object.alert_count > 0 %}
Active Alerts Found

This metric has {{ object.alert_count }} active alert(s) that will be affected:

    {% for alert in object.alerts.all %}
  • {{ alert.name }} - {{ alert.get_condition_display }}: {{ alert.threshold_value }}
  • {% endfor %}
{% endif %} {% if object.dashboard_count > 0 %}
Dashboard Usage Warning

This metric is currently displayed on {{ object.dashboard_count }} dashboard widget(s). Deleting it will cause these widgets to show no data.

{% endif %}
{% csrf_token %}
Deletion Confirmation
{% if object.alert_count > 0 %}
{% endif %} {% if object.dashboard_count > 0 %}
{% endif %}
{% endblock %} {% block js %} {% endblock %}