diff options
author | luxagraf <sng@luxagraf.net> | 2018-09-29 10:24:05 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-09-29 10:24:05 -0500 |
commit | a05269998fc1100e7b969c9516fcb2d80d4a7afd (patch) | |
tree | 92a74e1df489d1aae373339aaf0d186228cb128f | |
parent | 7fdb835854c6e42ae3d0425abcd8649a4c6f88c5 (diff) |
changed campsite price display in admin
-rw-r--r-- | app/locations/models.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/locations/models.py b/app/locations/models.py index 24b3234..73fd937 100644 --- a/app/locations/models.py +++ b/app/locations/models.py @@ -257,8 +257,10 @@ class Campsite(models.Model): '''Get the price and total price for display in admin ''' if not self.campsite_price: price = 0 - total = self.nights_stayed * price - return "{0} ({1}/night)".format(total, self.campsite_price) + else: + price = self.campsite_price + total = self.nights_stayed * price + return "${0} (${1})".format(price, total) def save(self, *args, **kwargs): created = self.pk is None |