Skip to content

Commit e55c2c0

Browse files
committed
chore(feed): use config system to specify amount of advisory entries
1 parent 2e5ab70 commit e55c2c0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def set_debug_flag(debug):
4040
TRACKER_PASSWORD_LENGTH_MAX = config_tracker.getint('password_length_max')
4141
TRACKER_SUMMARY_LENGTH_MAX = config_tracker.getint('summary_length_max')
4242
TRACKER_LOG_ENTRIES_PER_PAGE = config_tracker.getint('log_entries_per_page')
43+
TRACKER_FEED_ADVISORY_ENTRIES = config_tracker.getint('feed_advisory_entries')
4344

4445
config_sqlite = config['sqlite']
4546
SQLITE_JOURNAL_MODE = config_sqlite['journal_mode']

config/00-default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ password_length_min = 16
88
password_length_max = 64
99
summary_length_max = 200
1010
log_entries_per_page = 10
11+
feed_advisory_entries = 15
1112

1213
[pacman]
1314
handle_cache_time = 120

tracker/view/advisory.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pytz import UTC
1111
from sqlalchemy import and_
1212

13+
from config import TRACKER_FEED_ADVISORY_ENTRIES
1314
from config import TRACKER_ISSUE_URL
1415
from tracker import db
1516
from tracker import tracker
@@ -60,8 +61,8 @@ def get_advisory_data():
6061
@tracker.route('/advisories/feed.atom', methods=['GET'])
6162
@tracker.route('/advisory/feed.atom', methods=['GET'])
6263
def advisory_atom():
63-
last_recent_entries = 15
64-
data = get_advisory_data()['published'][:last_recent_entries]
64+
data = get_advisory_data()['published'][:TRACKER_FEED_ADVISORY_ENTRIES]
65+
6566
feed = FeedGenerator()
6667
feed.title('Arch Linux Security - Recent advisories')
6768
feed.description('Arch Linux recent advsisories RSS feed')

0 commit comments

Comments
 (0)