From bdb9ee9aeacc69e7c80185186d0f099286d04946 Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Thu, 23 Sep 2021 16:24:45 +0200 Subject: [PATCH] Force __str__ methods of models to return str types instead of proxy types --- CHANGELOG.rst | 8 ++++++++ aleksis/apps/chronos/models.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0b8bd712..30ddf5cf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. +Unreleased +---------- + +Fixed +~~~~~ + +* ``Event.__str__`` returned a proxy type instead a string. + `2.0rc2`_ - 2021-08-01 ---------- diff --git a/aleksis/apps/chronos/models.py b/aleksis/apps/chronos/models.py index 07dc3fda..e4638d96 100644 --- a/aleksis/apps/chronos/models.py +++ b/aleksis/apps/chronos/models.py @@ -976,7 +976,7 @@ class Event(SchoolTermRelatedExtensibleModel, GroupPropertiesMixin, TeacherPrope if self.title: return self.title else: - return _(f"Event {self.pk}") + return _("Event {pk}").format(pk=self.pk) @property def raw_period_from_on_day(self) -> TimePeriod: -- GitLab