Skip to content

Commit 4516d4c

Browse files
authored
fix: Fix 500 error where empty records would fail to render (google#3495)
because of human_link. E.g. https://osv.dev/vulnerability/ALEA-2021:4152 Tested the fix locally by changing the human_link value in memory while debugging the website locally.
1 parent 77718d9 commit 4516d4c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

source.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
extension: '.json'
1010
db_prefix: ['ALBA-']
1111
ignore_git: False
12-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
12+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
1313
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
1414
editable: False
1515
strict_validation: False
@@ -24,7 +24,7 @@
2424
extension: '.json'
2525
db_prefix: ['ALEA-']
2626
ignore_git: False
27-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
27+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
2828
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
2929
editable: False
3030
strict_validation: False
@@ -39,7 +39,7 @@
3939
extension: '.json'
4040
db_prefix: ['ALSA-']
4141
ignore_git: False
42-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
42+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
4343
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
4444
editable: False
4545
strict_validation: False

source_test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
extension: '.json'
1010
db_prefix: ['ALBA-']
1111
ignore_git: False
12-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
12+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
1313
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
1414
editable: False
1515
strict_validation: True
@@ -24,7 +24,7 @@
2424
extension: '.json'
2525
db_prefix: ['ALEA-']
2626
ignore_git: False
27-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
27+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
2828
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
2929
editable: False
3030
strict_validation: True
@@ -39,7 +39,7 @@
3939
extension: '.json'
4040
db_prefix: ['ALSA-']
4141
ignore_git: False
42-
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
42+
human_link: '{% if ECOSYSTEMS|length >= 2 %}https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html{% endif %}'
4343
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
4444
editable: False
4545
strict_validation: True

0 commit comments

Comments
 (0)