Fix a couple of bugs

This commit is contained in:
2025-04-25 23:14:10 +02:00
parent 647894bca7
commit a2c857a3cd
3 changed files with 7 additions and 3 deletions

View File

@@ -137,6 +137,10 @@ class Catalog(BaseBook):
ordering = ["manufacturer", "publication_year"]
def __str__(self):
# if the object is new, return an empty string to avoid
# calling self.scales.all() which would raise a infinite recursion
if self.pk is None:
return str() # empty string
scales = self.get_scales()
return "%s %s %s" % (self.manufacturer.name, self.years, scales)

View File

@@ -1,4 +1,4 @@
from ram.utils import git_suffix
__version__ = "0.17.2"
__version__ = "0.17.3"
__version__ += git_suffix(__file__)

View File

@@ -273,11 +273,11 @@ class RollingStockAdmin(SortableAdminBase, admin.ModelAdmin):
settings.CSV_SEPARATOR_ALT.join(
t.name for t in obj.tags.all()
),
obj.decoder_interface,
obj.get_decoder_interface_display(),
obj.decoder,
obj.address,
obj.purchase_date,
obj.shop,
obj.purchase_date,
obj.price,
properties,
]