From 476f9d9c55f59d7c1235431984f2f12838772071 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sun, 15 Mar 2026 21:29:47 +0100 Subject: [PATCH] Add missing __str__ to flag and task models. --- hypha/apply/flags/models.py | 3 +++ hypha/apply/todo/models.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hypha/apply/flags/models.py b/hypha/apply/flags/models.py index 8806afce58..95dc17ac7e 100644 --- a/hypha/apply/flags/models.py +++ b/hypha/apply/flags/models.py @@ -24,3 +24,6 @@ class Flag(models.Model): settings.AUTH_USER_MODEL, on_delete=models.PROTECT, ) + + def __str__(self): + return f"{self.FLAG_TYPES.get(self.type, self.type)} flag by {self.user} on {self.target}" diff --git a/hypha/apply/todo/models.py b/hypha/apply/todo/models.py index f9dab5ded9..dd5bfec5aa 100644 --- a/hypha/apply/todo/models.py +++ b/hypha/apply/todo/models.py @@ -32,5 +32,8 @@ class Task(models.Model): class Meta: ordering = ("-created_at",) + def __str__(self): + return f"{self.get_code_display()} – {self.user or 'group'}" + def save(self, **kwargs): return super().save(**kwargs)