diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index de4b46d..3f20e5c 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -10,6 +10,8 @@ from django.http import Http404 from django.contrib import messages from django.contrib.auth.mixins import UserPassesTestMixin, LoginRequiredMixin +from django.contrib.messages.views import SuccessMessageMixin + from .forms import ( ExplorerCreationForm, PlaceForm, @@ -40,10 +42,11 @@ class IsSubmitter(UserPassesTestMixin, View): self.request, 'You do not have permission to do this.') return False -class SignUpView(CreateView): +class SignUpView(SuccessMessageMixin, CreateView): form_class = ExplorerCreationForm success_url = reverse_lazy('login') template_name = 'signup.html' + success_message = 'User created' class PlaceListView(IsAuthenticated, View): def get(self, request):