mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
dc2c9aa662
commit
c740cce5e4
@ -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
|
||||
|
@ -53,7 +53,6 @@ class PartIndex(InvenTreeRoleMixin, ListView):
|
||||
|
||||
role_required = 'part.view'
|
||||
|
||||
|
||||
def get_queryset(self):
|
||||
return Part.objects.all().select_related('category')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user