I have a DeleteView:
class LectureDelete(SuccessMessageMixin, DeleteView):
model = Lecture
success_message = "Die Veranstaltung wurde gelöscht"
success_url = '/'
def get_object(self):
qs = super(LectureDelete, self).get_object()
if self.request.user.has_perm('edit_lecture', qs):
return qs
else:
raise exceptions.PermissionDenied
And in my template to which the success_url links, I have the following code, which works fine with other messages:
{% if messages %}
{% for message in messages %}
<p class="alert alert-dismissable {% if message.tags %}alert-{{ message.tags }}"{% endif %}>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{{ message }}
</p>
{% endfor %}
{% endif %}
But the message is not shown. Am I missing something? What am I doing worng? Thanks!