@login_required
@permission_required('workshops.delete_event', raise_exception=True)
def event_delete(request, event_ident):
    """Delete event, its tasks and related awards."""
    try:
        event = Event.get_by_ident(event_ident)
        event.delete()

        messages.success(request,
                         'Event and its tasks were deleted successfully.')
        return redirect(reverse('all_events'))
    except __HOLE__:
        raise Http404("No event found matching the query.")
    except ProtectedError as e:
        return failed_to_delete(request, event, e.protected_objects)
dataset/ETHPy150Open swcarpentry/amy/workshops/views.py/event_delete