Skip to content

Commit

Permalink
Optimize db access when checking site name, add release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsalvino committed Jun 28, 2022
1 parent 2cad21a commit 1bda046
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Release Notes

* Only render SEO meta tags if a page object is present in the template context.

* Check for empty site when getting site name.


2.0.0
-----
Expand All @@ -25,6 +27,8 @@ Release Notes

* Only render SEO meta tags if a page object is present in the template context.

* Check for empty site when getting site name.


1.0.0
-----
Expand Down
5 changes: 3 additions & 2 deletions wagtailseo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ def seo_sitename(self) -> str:
Gets the site name.
Override in your Page model as necessary.
"""
if self.get_site():
return self.get_site().site_name
s = self.get_site()
if s:
return s.site_name
return ""

@property
Expand Down

0 comments on commit 1bda046

Please sign in to comment.