Update views.py

Verify and alert if there is dependent components when deleting.