{% extends "base.html" %} {% load static %} {% block title %}Delete Department: {{ department.name }}{% endblock %} {% block css %} {% endblock %} {% block content %}

Delete Department: {{ department.name }}

Confirm Department Deletion

Warning: This action cannot be undone

You are about to permanently delete the department {{ department.name }}. This will affect all related data and cannot be reversed.

Department Information
Department Name: {{ department.name }}
Department Code: {{ department.department_code }}
Type: {{ department.get_department_type_display }}
Status: {% if department.is_active %} Active {% else %} Inactive {% endif %}
Department Head: {% if department.department_head %} {{ department.department_head.get_full_name }} {% else %} Not assigned {% endif %}
Parent Department: {% if department.parent_department %} {{ department.parent_department.name }} {% else %} None (Top Level) {% endif %}
Location: {{ department.location|default:"Not specified" }}
Created: {{ department.created_at|date:"M d, Y" }}
Impact Assessment
Employees {% if department.employees.count > 0 %} {{ department.employees.count }} affected {% else %} None affected {% endif %}
{% if department.employees.count > 0 %}

Warning: {{ department.employees.count }} employee(s) are currently assigned to this department. These employees will need to be reassigned before deletion or they will be left without a department.

{% else %}

No employees are currently assigned to this department.

{% endif %}
Sub-Departments {% if department.subdepartments.count > 0 %} {{ department.subdepartments.count }} affected {% else %} None affected {% endif %}
{% if department.subdepartments.count > 0 %}

Warning: {{ department.subdepartments.count }} sub-department(s) are currently under this department. These sub-departments will need to be reassigned or deleted before proceeding.

{% else %}

No sub-departments exist under this department.

{% endif %}
Schedules {% if schedules_count > 0 %} {{ schedules_count }} affected {% else %} None affected {% endif %}
{% if schedules_count > 0 %}

Note: {{ schedules_count }} schedule(s) are associated with this department. These schedules will be orphaned if the department is deleted.

{% else %}

No schedules are associated with this department.

{% endif %}
Alternative Actions

Instead of deleting this department, consider these alternatives:

Deactivate Department

Mark the department as inactive instead of deleting it. This preserves historical data while preventing new assignments.

Edit Department
Merge Department

Transfer employees to another department and then deactivate this one to effectively merge departments.

View All Departments
{% csrf_token %}
Cancel
{% endblock %} {% block js %} {% endblock %}