2016-12-07 22:23:11 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
Auth views
|
|
|
|
"""
|
|
|
|
|
|
|
|
from __future__ import unicode_literals, absolute_import
|
|
|
|
|
|
|
|
from tailbone.views import auth as base
|
|
|
|
|
|
|
|
|
2016-12-11 18:08:39 -06:00
|
|
|
class AuthenticationView(base.AuthenticationView):
|
|
|
|
"""
|
|
|
|
Prevent password change for 'chuck' user
|
|
|
|
"""
|
2016-12-07 22:23:11 -06:00
|
|
|
|
2016-12-11 18:08:39 -06:00
|
|
|
def change_password(self):
|
|
|
|
if self.request.user and self.request.user.username == 'chuck':
|
|
|
|
self.request.session.flash("Cannot change password for 'chuck' in Rattail Demo")
|
|
|
|
return self.redirect(self.request.get_referrer())
|
|
|
|
return super(AuthenticationView, self).change_password()
|
2016-12-07 22:23:11 -06:00
|
|
|
|
|
|
|
|
2016-12-11 18:08:39 -06:00
|
|
|
def includeme(config):
|
|
|
|
AuthenticationView.defaults(config)
|