use google convention for docstrings

This commit is contained in:
thomas girod
2024-07-12 09:34:16 +02:00
parent 07b625d4aa
commit 8c69a94488
72 changed files with 970 additions and 1694 deletions

View File

@ -48,8 +48,7 @@ def get_default_view_group():
class Forum(models.Model):
"""
The Forum class, made as a tree to allow nice tidy organization
"""The Forum class, made as a tree to allow nice tidy organization.
owner_club allows club members to moderate there own topics
edit_groups allows to put any group as a forum admin
@ -157,7 +156,7 @@ class Forum(models.Model):
c.apply_rights_recursively()
def copy_rights(self):
"""Copy, if possible, the rights of the parent folder"""
"""Copy, if possible, the rights of the parent folder."""
if self.parent is not None:
self.owner_club = self.parent.owner_club
self.edit_groups.set(self.parent.edit_groups.all())
@ -187,7 +186,7 @@ class Forum(models.Model):
return False
def check_loop(self):
"""Raise a validation error when a loop is found within the parent list"""
"""Raise a validation error when a loop is found within the parent list."""
objs = []
cur = self
while cur.parent is not None:
@ -299,9 +298,7 @@ class ForumTopic(models.Model):
class ForumMessage(models.Model):
"""
"A ForumMessage object represents a message in the forum" -- Cpt. Obvious
"""
"""A message in the forum (thx Cpt. Obvious.)."""
topic = models.ForeignKey(
ForumTopic, related_name="messages", on_delete=models.CASCADE
@ -425,7 +422,8 @@ class ForumMessageMeta(models.Model):
class ForumUserInfo(models.Model):
"""
"""The forum infos of a user.
This currently stores only the last date a user clicked "Mark all as read".
However, this can be extended with lot of user preferences dedicated to a
user, such as the favourite topics, the signature, and so on...