Skip to content

Commit

Permalink
Do nothing if the user is anonymous.
Browse files Browse the repository at this point in the history
fixes #548
  • Loading branch information
tonioo committed Apr 16, 2014
1 parent a840656 commit d3cd246
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modoboa/core/views/auth.py
Expand Up @@ -61,8 +61,11 @@ def dologin(request):


def dologout(request):
events.raiseEvent("UserLogout", request)
logger = logging.getLogger("modoboa.auth")
logger.info(_("User '%s' logged out" % request.user.username))
logout(request)
"""Logout the current user.
"""
if not request.user.is_anonymous():
events.raiseEvent("UserLogout", request)
logger = logging.getLogger("modoboa.auth")
logger.info(_("User '%s' logged out" % request.user.username))
logout(request)
return HttpResponseRedirect(reverse(dologin))

0 comments on commit d3cd246

Please sign in to comment.