StrictAuthentication - Auto log-out inactive users

1
2
3
4
5
6
from django.contrib.auth import logout

class StrictAuthentication:
        def process_view(self,request,view_func,view_args,view_kwargs):
                if request.user.is_authenticated() and not request.user.is_active:
                        logout(request)

Comments

(Forgotten your password?)

You may use Markdown syntax here, but raw HTML will be removed.