Use HTMX in UE details

This commit is contained in:
2026-09-09 13:24:54 +02:00
parent 5f3e2d13ba
commit d47e1f394b
12 changed files with 407 additions and 252 deletions
+5 -1
View File
@@ -125,7 +125,11 @@ class UE(models.Model):
Returns:
True if the user has already posted a comment on this UE, else False.
"""
return self.comments.filter(author=user).exists()
self._has_user_commented = getattr(self, "_has_user_commented", {})
self._has_user_commented[user] = self._has_user_commented.get(
user, self.comments.filter(author=user).exists()
)
return self._has_user_commented[user]
@cached_property
def grade_global_average(self):