From 8b1570707d16b8a321bf5341036e74cf4e98b11b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:02:23 +0000 Subject: [PATCH 1/3] Initial plan From e3bb50055f92bbdcfa2380495af106c66c29f522 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:16:25 +0000 Subject: [PATCH 2/3] Fix BuildError when last_issue.url_segment is None Use fix_journal_last_issue() to populate url_segment in journal_detail and about_journal views. Add defensive template guards to check last_issue.url_segment before building URLs. Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com> --- opac/webapp/main/views.py | 4 ++-- opac/webapp/templates/journal/detail.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/opac/webapp/main/views.py b/opac/webapp/main/views.py index d7529fe1..7eacf859 100644 --- a/opac/webapp/main/views.py +++ b/opac/webapp/main/views.py @@ -509,7 +509,7 @@ def journal_detail(url_seg): sections = [] recent_articles = [] - latest_issue = journal.last_issue + latest_issue = utils.fix_journal_last_issue(journal) if latest_issue: latest_issue_legend = descriptive_short_format( @@ -642,7 +642,7 @@ def about_journal(url_seg): controllers.set_last_issue_and_issue_count(journal) - latest_issue = journal.last_issue + latest_issue = utils.fix_journal_last_issue(journal) if latest_issue: latest_issue_legend = descriptive_short_format( diff --git a/opac/webapp/templates/journal/detail.html b/opac/webapp/templates/journal/detail.html index 64f792c6..bee8e853 100644 --- a/opac/webapp/templates/journal/detail.html +++ b/opac/webapp/templates/journal/detail.html @@ -60,11 +60,11 @@