mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-14 16:29:12 +00:00
Fix UE tests
This commit is contained in:
+4
-6
@@ -124,13 +124,11 @@ class UE(models.Model):
|
||||
This function checks that no other comment has been posted by a specified user.
|
||||
|
||||
Returns:
|
||||
True if the user has already posted a comment on this UE, else False.
|
||||
True if the user has already posted a comment on this UE or is anonymous, else False.
|
||||
"""
|
||||
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]
|
||||
if user.is_anonymous:
|
||||
return True
|
||||
return self.comments.filter(author=user).exists()
|
||||
|
||||
@cached_property
|
||||
def grade_global_average(self):
|
||||
|
||||
Reference in New Issue
Block a user