Remove custom logic for User views

this was to protect the 'chuck' user but we now have better (upstream) ways
This commit is contained in:
Lance Edgar 2020-03-15 11:43:06 -05:00
parent 69316183f7
commit f1a01af3c9
2 changed files with 1 additions and 26 deletions

View file

@ -30,7 +30,7 @@ def includeme(config):
config.include('tailbone.views.subdepartments')
config.include('rattail_demo.web.views.tempmon')
config.include('rattail_demo.web.views.upgrades')
config.include('rattail_demo.web.views.users')
config.include('tailbone.views.users')
config.include('rattail_demo.web.views.vendors')
# core-pos views

View file

@ -1,25 +0,0 @@
# -*- coding: utf-8; -*-
"""
User views
"""
from __future__ import unicode_literals, absolute_import
from tailbone.views import users as base
class UsersView(base.UsersView):
"""
Prevent edit/delete for 'chuck'
"""
def editable_instance(self, user):
return user.username not in ('chuck', 'demo')
def deletable_instance(self, user):
return user.username not in ('chuck', 'demo')
def includeme(config):
UsersView.defaults(config)
base.UserEventsView.defaults(config)