From 4d98f43d95c8b3ab017ee92a40eac04156c25ee9 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Mon, 10 Jul 2023 07:35:38 -0600 Subject: [PATCH] Fix promo codes 500 error I had increased the length of the tuple that receipt items returned, but not updated the corresponding default_cost property. Also fixes the display of promo codes on the index page. --- uber/models/__init__.py | 4 ++-- uber/templates/preregistration/index.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/uber/models/__init__.py b/uber/models/__init__.py index 28ab68c4a..51efe4b75 100644 --- a/uber/models/__init__.py +++ b/uber/models/__init__.py @@ -417,8 +417,8 @@ def __getattr__(self, name): try: return sum(item[0] * item[1] for item in cost_calc[1].items()) / 100 except AttributeError: - if len(cost_calc) > 2: - return cost_calc[1] * cost_calc[2] / 100 + if len(cost_calc) > 3: + return cost_calc[1] * cost_calc[3] / 100 else: return cost_calc[1] / 100 except Exception: diff --git a/uber/templates/preregistration/index.html b/uber/templates/preregistration/index.html index 0d261aba3..2dc364634 100644 --- a/uber/templates/preregistration/index.html +++ b/uber/templates/preregistration/index.html @@ -56,7 +56,17 @@