From f1a01af3c91ccb6bca603c3cbf90ec3d6026f326 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 15 Mar 2020 11:43:06 -0500 Subject: [PATCH] Remove custom logic for User views this was to protect the 'chuck' user but we now have better (upstream) ways --- rattail_demo/web/views/__init__.py | 2 +- rattail_demo/web/views/users.py | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 rattail_demo/web/views/users.py diff --git a/rattail_demo/web/views/__init__.py b/rattail_demo/web/views/__init__.py index c23ec2d..77c892f 100644 --- a/rattail_demo/web/views/__init__.py +++ b/rattail_demo/web/views/__init__.py @@ -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 diff --git a/rattail_demo/web/views/users.py b/rattail_demo/web/views/users.py deleted file mode 100644 index 0cdf5d4..0000000 --- a/rattail_demo/web/views/users.py +++ /dev/null @@ -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)