d5a9b5c471
to take new 'demo' user into account, but also more readable
26 lines
517 B
Python
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)
|