rattail-demo/rattail_demo/web/views/users.py
Lance Edgar d5a9b5c471 Change how we prevent edit/delete for demo users
to take new 'demo' user into account, but also more readable
2017-08-13 23:47:17 -05:00

26 lines
517 B
Python

# -*- 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)