Skip to content

Commit

Permalink
Update function get_sitemap_urls on magazine /models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoriussuwandi authored Jul 15, 2023
1 parent b1dea02 commit d1bbc26
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions magazine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,14 @@ class Meta:
models.Index(fields=["drupal_node_id"]),
]

def get_sitemap_urls(self) -> list[dict]:
return [{"location": self.full_url, "lastmod": self.latest_revision_created_at}]

def get_sitemap_urls(self,changefreq=None,priority=None) -> list[dict]:
return [
{
"location": self.full_url,
"lastmod": self.latest_revision_created_at,
"changefreq":changefreq
},
]

class MagazineArticleTag(TaggedItemBase):
content_object = ParentalKey(
Expand Down Expand Up @@ -344,15 +349,16 @@ class MagazineArticle(DrupalFields, Page): # type: ignore
parent_page_types = ["MagazineIssue"]
subpage_types: list[str] = []

def get_sitemap_urls(self) -> list[dict]:
def get_sitemap_urls(self,changefreq=None,priority=None) -> list[dict]:
return [
{
"location": self.full_url,
"lastmod": self.latest_revision_created_at,
"priority": 1,
"changefreq":changefreq,
"priority": 1
},
]

@property
def is_public_access(self) -> bool:
"""Check whether article should be accessible to all readers or only
Expand Down

0 comments on commit d1bbc26

Please sign in to comment.