Skip to content

Commit

Permalink
#4479 fixes submitted and accepted date display
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Nov 4, 2024
1 parent 7ca333d commit f0d5e44
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit f0d5e44

Please sign in to comment.