Esempio n. 1
0
def logout(request):
    if request.user.is_authenticated:
        deauth(request)
        messages.info(request, "You are succefully log out ")
        return redirect('/user/login')

    return redirect('/user/login')
Esempio n. 2
0
def logout(request):
      if(request.user.is_authenticated):
          
        deauth(request)
        messages.add_message(request,messages.SUCCESS,'User has been successfully logged out  ')
      else:
          messages.add_message(request,messages.INFO,'Login first')
      return redirect('/login')
Esempio n. 3
0
def logout(request):
    if request.user.is_authenticated:
        deauth(request)
        messages.info(request, "You Successfully log out")
        form = AuthenticationForm()
        return render(request, 'user/login.html', {'form': form})

    messages.info(request, 'You Are not log in ')
    form = AuthenticationForm()
    return render(request, 'user/login.html', {'form': form})
Esempio n. 4
0
def logout(request):
    if request.user.is_authenticated:
        if 's_ud' in request.session:
            s_ud = request.session.get('s_ud')
            A_p = ActivityPeriod.objects.get(id=s_ud)
            A_p.end_time = timezone.now()
            A_p.save()
            del request.session['s_ud']
            deauth(request)
            messages.info(request, "You are succefully log out ")
            return redirect('/user/login')

    return redirect('/user/login')
Esempio n. 5
0
def logout(request):
    if request.user.is_authenticated:
        deauth(request)
        messages.info(request, 'You have been successfully Logged out')

    return redirect('/user/login')
Esempio n. 6
0
def logout(request):
    if request.user.is_authenticated:
        deauth(request)
        messages.info(request, "You Have Successfully Loggd Out")
    return redirect('/user/login')
Esempio n. 7
0
def logout(request):
    if request.user.is_authenticated:
       deauth(request)
       messages.info(request, 'Log Out Was Successful')
    return redirect('/user/login')