Skip to content

Commit 377636a

Browse files
committed
Avoid HTTP 500 on /moderation/news for old news without versions
1 parent e3d6e1c commit 377636a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

app/views/redaction/news/_topbar.html.haml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
- if show_backlink
33
.backlink
44
= link_to image_tag("feather-icons/dist/icons/arrow-left.svg", alt: "Retour à l’espace de rédaction"), '/redaction'
5-
.lastmodifications
6-
- revision = news.versions.first
7-
.revision-table
8-
.revision-cell
9-
= revision.version
10-
%p
11-
dernière modification
12-
%br
13-
%span.revision-date
14-
= "le #{I18n.l(revision.created_at, :format => '%d %B %Y à %H:%M:%S')}"
5+
- if news.versions.count > 0
6+
.lastmodifications
7+
- revision = news.versions.first
8+
.revision-table
9+
.revision-cell
10+
= revision.version
11+
%p
12+
dernière modification
13+
%br
14+
%span.revision-date
15+
= "le #{I18n.l(revision.created_at, :format => '%d %B %Y à %H:%M:%S')}"
1516
= render 'attendees', attendees: news.attendees, enable_reassign: false

0 commit comments

Comments
 (0)