From 206b9aea574535d03f64e147edb6866808a9a994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sat, 4 Jan 2025 19:06:10 +0100 Subject: [PATCH] Make purchase date a private field as well --- ram/bookshelf/serializers.py | 4 ++-- ram/portal/templates/bookshelf/book.html | 2 +- ram/portal/templates/rollingstock.html | 2 +- ram/ram/__init__.py | 2 +- ram/roster/serializers.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ram/bookshelf/serializers.py b/ram/bookshelf/serializers.py index aa93d98..88811ea 100644 --- a/ram/bookshelf/serializers.py +++ b/ram/bookshelf/serializers.py @@ -26,7 +26,7 @@ class BookSerializer(serializers.ModelSerializer): class Meta: model = Book - exclude = ("price",) + exclude = ("purchase_date", "price",) read_only_fields = ("creation_time", "updated_time") @@ -37,5 +37,5 @@ class CatalogSerializer(serializers.ModelSerializer): class Meta: model = Catalog - exclude = ("price",) + exclude = ("purchase_date", "price",) read_only_fields = ("creation_time", "updated_time") diff --git a/ram/portal/templates/bookshelf/book.html b/ram/portal/templates/bookshelf/book.html index c8e1a35..171db8e 100644 --- a/ram/portal/templates/bookshelf/book.html +++ b/ram/portal/templates/bookshelf/book.html @@ -108,11 +108,11 @@ Publication year {{ book.publication_year|default:"-" }} + {% if request.user.is_staff %} Purchase date {{ book.purchase_date|default:"-" }} - {% if request.user.is_staff %} Price ({{ site_conf.currency }}) {{ book.price|default:"-" }} diff --git a/ram/portal/templates/rollingstock.html b/ram/portal/templates/rollingstock.html index 86b04a5..ece8008 100644 --- a/ram/portal/templates/rollingstock.html +++ b/ram/portal/templates/rollingstock.html @@ -182,11 +182,11 @@ Production year {{ rolling_stock.production_year|default:"-" }} + {% if request.user.is_staff %} Purchase date {{ rolling_stock.purchase_date|default:"-" }} - {% if request.user.is_staff %} Price ({{ site_conf.currency }}) {{ rolling_stock.price|default:"-" }} diff --git a/ram/ram/__init__.py b/ram/ram/__init__.py index 891494d..df8978a 100644 --- a/ram/ram/__init__.py +++ b/ram/ram/__init__.py @@ -1,4 +1,4 @@ from ram.utils import git_suffix -__version__ = "0.15.2" +__version__ = "0.15.3" __version__ += git_suffix(__file__) diff --git a/ram/roster/serializers.py b/ram/roster/serializers.py index e6f41be..f7e71ae 100644 --- a/ram/roster/serializers.py +++ b/ram/roster/serializers.py @@ -28,5 +28,5 @@ class RollingStockSerializer(serializers.ModelSerializer): class Meta: model = RollingStock - exclude = ("price",) + exclude = ("purchase_date", "price",) read_only_fields = ("creation_time", "updated_time")