2020-03-16 19:47:17 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
2016-12-07 22:07:12 -06:00
|
|
|
"""
|
|
|
|
Person views
|
|
|
|
"""
|
|
|
|
|
|
|
|
from tailbone.views import people as base
|
2020-03-16 19:47:17 -05:00
|
|
|
from tailbone_corepos.views import people as corepos_base
|
2016-12-07 22:07:12 -06:00
|
|
|
|
|
|
|
|
2020-03-16 19:47:17 -05:00
|
|
|
class PersonView(corepos_base.PersonView):
|
2016-12-07 22:07:12 -06:00
|
|
|
"""
|
|
|
|
Prevent edit/delete for Chuck Norris
|
|
|
|
"""
|
|
|
|
|
|
|
|
def editable_instance(self, person):
|
|
|
|
return person.uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
|
|
|
|
|
|
|
|
def deletable_instance(self, person):
|
|
|
|
return person.uuid != '30d1fe06bcf411e6a7c23ca9f40bc550'
|
|
|
|
|
|
|
|
|
|
|
|
def includeme(config):
|
2016-12-10 10:15:41 -06:00
|
|
|
|
|
|
|
# autocomplete
|
|
|
|
config.add_route('people.autocomplete', '/people/autocomplete')
|
|
|
|
config.add_view(base.PeopleAutocomplete, route_name='people.autocomplete',
|
|
|
|
renderer='json', permission='people.list')
|
|
|
|
|
2020-03-16 19:47:17 -05:00
|
|
|
PersonView.defaults(config)
|
2019-06-15 15:31:09 -05:00
|
|
|
base.PersonNoteView.defaults(config)
|