Remove custom logic for preventing password change for 'chuck'

upstream now handles this
This commit is contained in:
Lance Edgar 2020-09-23 16:30:00 -05:00
parent 1e06066353
commit 2a34243e33
2 changed files with 1 additions and 25 deletions

View file

@ -8,7 +8,7 @@ def includeme(config):
# core views # core views
config.include('rattail_demo.web.views.common') config.include('rattail_demo.web.views.common')
config.include('rattail_demo.web.views.auth') config.include('tailbone.views.auth')
config.include('tailbone.views.progress') config.include('tailbone.views.progress')
config.include('tailbone.views.tables') config.include('tailbone.views.tables')

View file

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
"""
Auth views
"""
from __future__ import unicode_literals, absolute_import
from tailbone.views import auth as base
class AuthenticationView(base.AuthenticationView):
"""
Prevent password change for 'chuck' user
"""
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()
def includeme(config):
AuthenticationView.defaults(config)