From af2b062cc9eb3a7a624c3176bbaa4d642753cbe4 Mon Sep 17 00:00:00 2001 From: Mikan <72257910+Mikan-DS@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:11:22 +0300 Subject: [PATCH] update --- common/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/models.py b/common/models.py index 395ad5f..d7a4023 100644 --- a/common/models.py +++ b/common/models.py @@ -60,7 +60,12 @@ class ItemData(models.Model): verbose_name_plural = 'Информационные объекты' def __str__(self): - return f'{self.collection.verbose} "{self.title}" ({self.author.username})' + author = "" + if self.author: + author = f" ({self.author.username})" + else: + author = " (Archive)" + return f'{self.collection.verbose} "{self.title}"{author}' @property def dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: