From 0b962aa420250e6bae1d4474d645b356a380339f Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Tue, 30 Jan 2018 20:59:26 +0300 Subject: [PATCH] LIL-133, LIL-134 User menu & Logout --- apps/auth/views.py | 5 +++-- project/templates/lilcity/index.html | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) 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 %} +
+ {% if user.photo %} +
+ {% else %} +
+ {% endif %} + +
+ {% else %} + {% endif %}