diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index 87745e0..62afcb9 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -5,6 +5,7 @@ from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required +from django.contrib import messages from django.utils.decorators import method_decorator from django.core.urlresolvers import reverse @@ -44,8 +45,7 @@ class OverviewView(CreateView): self.object = form.save(commit=False) self.object.created_by = self.request.user self.object.save() - #FIXME: add messages to base.html - #messages.add_message(self.request, messages.SUCCESS, 'Host added.')) + messages.add_message(self.request, messages.SUCCESS, 'Host added.') return HttpResponseRedirect(self.get_success_url()) def get_context_data(self, *args, **kwargs): diff --git a/nsupdate/nsupdate/templates/base.html b/nsupdate/nsupdate/templates/base.html index 3a06a02..ae0e5b3 100644 --- a/nsupdate/nsupdate/templates/base.html +++ b/nsupdate/nsupdate/templates/base.html @@ -50,6 +50,16 @@
+
+ {% if messages %} + {% for message in messages %} +
+ + {{ message }} +
+ {% endfor %} + {% endif %} +
{% block content %}

Heyho!

Welcome to the base template. Extend this template in all other