From c740cce5e435523e800e15dcb73433c1673b2f46 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 6 Oct 2020 11:31:04 +1100 Subject: [PATCH] PEP fixes --- InvenTree/InvenTree/views.py | 9 +++------ InvenTree/part/views.py | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py index 9cd4aeb514..ca8f6c646c 100644 --- a/InvenTree/InvenTree/views.py +++ b/InvenTree/InvenTree/views.py @@ -22,7 +22,7 @@ from django.views.generic.base import TemplateView from part.models import Part, PartCategory from stock.models import StockLocation, StockItem from common.models import InvenTreeSetting, ColorTheme -from users.models import check_user_role, RuleSet +from users.models import check_user_role from .forms import DeleteForm, EditUserForm, SetPasswordForm, ColorThemeSelectForm from .helpers import str2bool @@ -700,12 +700,12 @@ class InvenTreeRoleMixin(PermissionRequiredMixin): """ # By default, no roles are required - # Roles must be specified + # Roles must be specified role_required = None def has_permission(self): """ - Determine if the current user + Determine if the current user """ roles_required = [] @@ -715,9 +715,6 @@ class InvenTreeRoleMixin(PermissionRequiredMixin): elif type(self.role_required) in [list, tuple]: roles_required = self.role_required - # List of permissions that will be required - permissions = [] - user = self.request.user # Superuser can have any permissions they desire diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index e352cddb08..09390bf8c0 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -53,7 +53,6 @@ class PartIndex(InvenTreeRoleMixin, ListView): role_required = 'part.view' - def get_queryset(self): return Part.objects.all().select_related('category')