Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove remaining dashboard functions in templatetags
IKarbowiak038b88793395
diff --git a/saleor/core/templatetags/dashboard.py b/saleor/core/templatetags/dashboard.pydeleted file mode 100644index dd83818d20..0000000000--- a/saleor/core/templatetags/dashboard.py+++ /dev/null@@ -1,15 +0,0 @@-from django.template import Library--from ...core.utils import get_country_name_by_code--register = Library()---def get_formset_form(formset, index):- return formset.forms[index]---def get_country_by_code(country_code):- return get_country_name_by_code(country_code)diff --git a/saleor/core/templatetags/status.py b/saleor/core/templatetags/status.pyindex a99bef85ce..c852af5966 100644--- a/saleor/core/templatetags/status.py+++ b/saleor/core/templatetags/status.py@@ -2,11 +2,6 @@ from django.template import Libraryfrom ...order import OrderStatusfrom ...payment import ChargeStatus-from ...product import ProductAvailabilityStatus, VariantAvailabilityStatus-from ...product.utils.availability import (- get_product_availability_status,- get_variant_availability_status,-)register = Library()@@ -14,7 +9,6 @@ register = Library()SUCCESSES = {ChargeStatus.FULLY_CHARGED, ChargeStatus.FULLY_REFUNDED}-LABEL_DANGER = "danger"LABEL_SUCCESS = "success"LABEL_DEFAULT = "default"@@ -37,28 +31,6 @@ def render_order_status(status, status_display=None):return {"label_cls": label_cls, "status": status_display or status}[email protected]_tag("status_label.html")-def render_availability_status(product):- status = get_product_availability_status(product)- display = ProductAvailabilityStatus.get_display(status)- if status == ProductAvailabilityStatus.READY_FOR_PURCHASE:- label_cls = LABEL_SUCCESS- else:- label_cls = LABEL_DANGER- return {"status": display, "label_cls": label_cls}--[email protected]_tag("status_label.html")-def render_variant_availability_status(variant):- status = get_variant_availability_status(variant)- display = VariantAvailabilityStatus.get_display(status)- if status == VariantAvailabilityStatus.AVAILABLE:- label_cls = LABEL_SUCCESS- else:- label_cls = LABEL_DANGER- return {"status": display, "label_cls": label_cls}--@register.inclusion_tag("dashboard/includes/_page_availability.html")def render_page_availability(page):ctx = {"is_visible": page.is_visible, "page": page}@@ -66,16 +38,3 @@ def render_page_availability(page):label_cls = LABEL_SUCCESSctx.update({"label_cls": label_cls})return ctx--[email protected]_tag("dashboard/includes/_collection_availability.html")-def render_collection_availability(collection):- if collection.is_visible:- label_cls = LABEL_SUCCESS- else:- label_cls = LABEL_DANGER- return {- "is_visible": collection.is_visible,- "collection": collection,- "label_cls": label_cls,- }