Revision 06828466 snf-astakos-app/astakos/im/views.py

b/snf-astakos-app/astakos/im/views.py
411 411
    """
412 412
    Wraps `django.contrib.auth.logout` and delete the cookie.
413 413
    """
414
    msg = 'Cookie deleted for %s' % (request.user.email)
415
    auth_logout(request)
416 414
    response = HttpResponse()
417
    response.delete_cookie(COOKIE_NAME, path='/', domain=COOKIE_DOMAIN)
418
    logger._log(LOGGING_LEVEL, msg, [])
415
    if request.user.is_authenticated():
416
        email = request.user.email
417
        auth_logout(request)
418
        response.delete_cookie(COOKIE_NAME, path='/', domain=COOKIE_DOMAIN)
419
        msg = 'Cookie deleted for %s' % email
420
        logger._log(LOGGING_LEVEL, msg, [])
419 421
    next = request.GET.get('next')
420 422
    if next:
421 423
        response['Location'] = next

Also available in: Unified diff