From 6a374f7fa0010ef62def8bbed09151b6b69ad60b Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Feb 2024 16:23:19 +0530 Subject: [PATCH] Rearrange --- datacenterlight/templatetags/custom_tags.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 5d0c01b3..4fcf05a2 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -160,8 +160,7 @@ def get_product_name(plan_name): product_name = "" if plan_name and plan_name.startswith("generic-"): first_index_hyphen = plan_name.index("-") + 1 - product_id = plan_name[first_index_hyphen: - (plan_name[first_index_hyphen:].index("-")) + first_index_hyphen] + product_id = plan_name[first_index_hyphen:(plan_name[first_index_hyphen:].index("-")) + first_index_hyphen] try: product = GenericProduct.objects.get(id=product_id) product_name = product.product_name