12334-generic-products-name-in-invoice #18

Merged
mravi merged 5 commits from 12334-generic-products-name-in-invoice into master 2024-03-22 11:25:49 +00:00
Showing only changes of commit 6a374f7fa0 - Show all commits

View file

@ -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