diff --git a/apps/auth/views.py b/apps/auth/views.py index 4cea8327..6c3cd79b 100644 --- a/apps/auth/views.py +++ b/apps/auth/views.py @@ -11,6 +11,7 @@ from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic import FormView, View from django.views.generic.edit import BaseFormView +from django.shortcuts import redirect from apps.notification.utils import send_email from .forms import LearnerRegistrationForm @@ -56,9 +57,9 @@ class LearnerRegistrationView(FormView): class LogoutView(View): - def post(self, request, *args, **kwargs): + def get(self, request, *args, **kwargs): logout(request) - return JsonResponse({"success": True}) + return redirect('/') class LoginView(FormView): diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index c867f308..655a3b79 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -122,11 +122,36 @@
+ {% if user.is_authenticated %} +