fix: fix 'inconsistent-return-statements' for pylint
This commit is contained in:
parent
281d654e32
commit
c01f9395f0
6 changed files with 8 additions and 1 deletions
|
@ -13,4 +13,3 @@ disable=fixme,
|
|||
consider-using-set-comprehension,
|
||||
empty-docstring,
|
||||
implicit-str-concat,
|
||||
inconsistent-return-statements,
|
||||
|
|
|
@ -117,6 +117,7 @@ class NewOrderBatchHandler(BatchHandler): # pylint: disable=too-many-public-met
|
|||
discount = self.config.get("sideshow.orders.default_item_discount")
|
||||
if discount:
|
||||
return decimal.Decimal(discount)
|
||||
return None
|
||||
|
||||
def autocomplete_customers_external(self, session, term, user=None):
|
||||
"""
|
||||
|
@ -1074,6 +1075,8 @@ class NewOrderBatchHandler(BatchHandler): # pylint: disable=too-many-public-met
|
|||
if not rows:
|
||||
return "Must add at least one valid item"
|
||||
|
||||
return None
|
||||
|
||||
def get_effective_rows(self, batch):
|
||||
"""
|
||||
Only rows with
|
||||
|
|
|
@ -105,6 +105,7 @@ class OrderHandler(GenericHandler):
|
|||
enum.ORDER_ITEM_STATUS_INACTIVE,
|
||||
):
|
||||
return "warning"
|
||||
return None
|
||||
|
||||
def resolve_pending_product(self, pending_product, product_info, user, note=None):
|
||||
"""
|
||||
|
|
|
@ -1057,6 +1057,7 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
variant = self.order_handler.item_status_to_variant(item.status_code)
|
||||
if variant:
|
||||
return f"has-background-{variant}"
|
||||
return None
|
||||
|
||||
def render_status_code(self, item, key, value): # pylint: disable=unused-argument
|
||||
""" """
|
||||
|
@ -1407,6 +1408,7 @@ class OrderItemView(MasterView):
|
|||
variant = self.order_handler.item_status_to_variant(item.status_code)
|
||||
if variant:
|
||||
return f"has-background-{variant}"
|
||||
return None
|
||||
|
||||
def configure_form(self, f):
|
||||
""" """
|
||||
|
|
|
@ -319,6 +319,7 @@ class PendingProductView(MasterView):
|
|||
enum = self.app.enum
|
||||
if product.status == enum.PendingProductStatus.IGNORED:
|
||||
return "has-background-warning"
|
||||
return None
|
||||
|
||||
def configure_form(self, f):
|
||||
""" """
|
||||
|
|
|
@ -68,6 +68,7 @@ class StoreView(MasterView):
|
|||
""" """
|
||||
if store.archived:
|
||||
return "has-background-warning"
|
||||
return None
|
||||
|
||||
def configure_form(self, f):
|
||||
""" """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue