diff options
author | 2022-08-23 13:11:35 +0400 | |
---|---|---|
committer | 2022-08-23 13:11:35 +0400 | |
commit | 2343f7ab5c738b5b28554c766e78eb6a663bd064 (patch) | |
tree | 924264f61a5fa7a8b569eef69e398e91de958b18 /pydis_site/apps/content/models | |
parent | Support Hyperlinked Tag Group Replacement (diff) |
Rename Tag Model Author Field
Renames the tag model `author` field to `authors` to better indicate
what's contained in the field, and updates the documentation.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/content/models')
-rw-r--r-- | pydis_site/apps/content/models/tag.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pydis_site/apps/content/models/tag.py b/pydis_site/apps/content/models/tag.py index e06ce067..1a20d775 100644 --- a/pydis_site/apps/content/models/tag.py +++ b/pydis_site/apps/content/models/tag.py @@ -16,7 +16,12 @@ class Commit(models.Model): ) message = models.TextField(help_text="The commit message.") date = models.DateTimeField(help_text="The date and time the commit was created.") - author = models.TextField(help_text="The person(s) who created the commit.") + authors = models.TextField(help_text=( + "The person(s) who created the commit. This is a serialized JSON object. " + "Refer to the GitHub documentation on the commit endpoint " + "(schema/commit.author & schema/commit.committer) for more info. " + "https://docs.github.com/en/rest/commits/commits#get-a-commit" + )) @property def url(self) -> str: @@ -30,7 +35,7 @@ class Commit(models.Model): def format_authors(self) -> collections.abc.Iterable[str]: """Return a nice representation of the author(s)' name and email.""" - for author in json.loads(self.author): + for author in json.loads(self.authors): yield f"{author['name']} <{author['email']}>" |