PEP style fixes

This commit is contained in:
Oliver Walters 2022-05-09 23:52:19 +10:00
parent 35fbb910e8
commit 6c0661a6f2
4 changed files with 13 additions and 11 deletions

View File

@ -149,7 +149,7 @@ class LocatePluginView(APIView):
raise ParseError(f"Plugin '{plugin}' is not installed, or does not support the location mixin") raise ParseError(f"Plugin '{plugin}' is not installed, or does not support the location mixin")
# StockItem to identify # StockItem to identify
item_pk= request.data.get('item', None) item_pk = request.data.get('item', None)
# StockLocation to identify # StockLocation to identify
location_pk = request.data.get('location', None) location_pk = request.data.get('location', None)
@ -165,7 +165,7 @@ class LocatePluginView(APIView):
# StockItem takes priority # StockItem takes priority
if item_pk: if item_pk:
try: try:
item = StockItem.objects.get(pk=item_pk) StockItem.objects.get(pk=item_pk)
offload_task('plugin.registry.call_function', plugin, 'locate_stock_item', item_pk) offload_task('plugin.registry.call_function', plugin, 'locate_stock_item', item_pk)
@ -178,7 +178,7 @@ class LocatePluginView(APIView):
elif location_pk: elif location_pk:
try: try:
location = StockLocation.objects.get(pk=location_pk) StockLocation.objects.get(pk=location_pk)
offload_task('plugin.registry.call_function', plugin, 'locate_stock_location', location_pk) offload_task('plugin.registry.call_function', plugin, 'locate_stock_location', location_pk)

View File

@ -44,6 +44,7 @@ def mixin_enabled(plugin, key, *args, **kwargs):
""" """
return plugin.mixin_enabled(key) return plugin.mixin_enabled(key)
@register.simple_tag() @register.simple_tag()
def mixin_available(mixin, *args, **kwargs): def mixin_available(mixin, *args, **kwargs):
""" """
@ -51,6 +52,7 @@ def mixin_available(mixin, *args, **kwargs):
""" """
return len(registry.with_mixin(mixin)) > 0 return len(registry.with_mixin(mixin)) > 0
@register.simple_tag() @register.simple_tag()
def navigation_enabled(*args, **kwargs): def navigation_enabled(*args, **kwargs):
""" """