PEP style fixes

This commit is contained in:
Oliver 2022-02-25 23:01:02 +11:00
parent 7c26d8f71d
commit 65e4ee5793
2 changed files with 4 additions and 4 deletions

View File

@ -74,8 +74,8 @@ class StockLocation(InvenTreeTree):
if loc.owner is not None:
return loc.owner
return None
return None
def check_ownership(self, user):
"""
Check if the user "owns" (is one of the owners of) the location.
@ -97,7 +97,7 @@ class StockLocation(InvenTreeTree):
# No owner set, for this location or any location above
# So, no ownership checks to perform!
return True
return user in owner.get_related_owners(include_group=True)
def get_absolute_url(self):

View File

@ -82,7 +82,7 @@ class StockLocationDetail(InvenTreeRoleMixin, DetailView):
model = StockLocation
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['ownership_enabled'] = common.models.InvenTreeSetting.get_setting('STOCK_OWNERSHIP_CONTROL')