2017-08-13 23:47:17 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
2016-12-07 22:07:12 -06:00
|
|
|
"""
|
|
|
|
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):
|
2017-08-13 23:47:17 -05:00
|
|
|
return user.username not in ('chuck', 'demo')
|
2016-12-07 22:07:12 -06:00
|
|
|
|
|
|
|
def deletable_instance(self, user):
|
2017-08-13 23:47:17 -05:00
|
|
|
return user.username not in ('chuck', 'demo')
|
2016-12-07 22:07:12 -06:00
|
|
|
|
|
|
|
|
|
|
|
def includeme(config):
|
|
|
|
UsersView.defaults(config)
|
2017-08-13 23:12:38 -05:00
|
|
|
base.UserEventsView.defaults(config)
|