Use HTMX in UE details

This commit is contained in:
2026-09-08 14:01:37 +02:00
parent 564baf3b56
commit f39c40d245
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):