diff --git a/inventory/__pycache__/models.cpython-311.pyc b/inventory/__pycache__/models.cpython-311.pyc index 714df4cc..9740f565 100644 Binary files a/inventory/__pycache__/models.cpython-311.pyc and b/inventory/__pycache__/models.cpython-311.pyc differ diff --git a/inventory/models.py b/inventory/models.py index f1cf8e61..ed06a68f 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -522,6 +522,18 @@ class Dealer(models.Model, LocalizedNameMixin): except SubscriptionPlan.DoesNotExist: return None + @property + def get_plan_price(self): + """Get the price of the active subscription plan for the dealer.""" + active_plan = self.get_active_plan + if active_plan: + subscription_plan = SubscriptionPlan.objects.filter( + name=active_plan.plan + ).first() + if subscription_plan: + return subscription_plan.price + return None + diff --git a/templates/dealers/dealer_detail.html b/templates/dealers/dealer_detail.html index 203ba916..e2f8dbc3 100644 --- a/templates/dealers/dealer_detail.html +++ b/templates/dealers/dealer_detail.html @@ -144,7 +144,7 @@
{% trans 'Active until' %}: {{ dealer.get_active_plan.end_date|date}}
