Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the display of date_submitted and date_accepted on OLH and Material themes #4480

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/submission/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,30 @@ def metrics(self):
def has_galley(self):
return self.galley_set.all().exists()

@cache(600)
def publication_detail_settings(self):
display_date_accepted = self.journal.get_setting(
group_name='article',
setting_name='display_date_accepted',
)
display_date_submitted = self.journal.get_setting(
group_name='article',
setting_name='display_date_submitted',
)
return display_date_submitted, display_date_accepted

@property
def has_publication_details(self):
"""Determines if an article has publication details override"""
display_date_submitted, display_date_accepted = self.publication_detail_settings()
return(
self.page_range
or self.article_number
or self.publisher_name
or self.publication_title
or self.ISSN_override
or (display_date_submitted and self.date_submitted)
or (display_date_accepted and self.date_accepted)
)

@property
Expand Down