Skip to content

Commit c82905b

Browse files
committed
Code format: applied linter suggestions
1 parent cc4fd27 commit c82905b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cernopendata/modules/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Endpoints accessible via the CERN Open Data Portal API."""

cernopendata/modules/api/news.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""News endpoint accessible via the CERN Open Data Portal API"""
1+
"""News endpoint accessible via the CERN Open Data Portal API."""
22

33
from datetime import datetime
44

@@ -11,12 +11,14 @@
1111

1212
@blueprint.route("/news.xml", methods=["GET"])
1313
def get_latest_news():
14-
"""Returns the set amount of latest news from the Open Data Portal"""
15-
limit = request.args.get('limit', default=10, type=int)
14+
"""Returns the set amount of latest news from the Open Data Portal."""
15+
limit = request.args.get("limit", default=10, type=int)
1616
limit = min(abs(limit), 128)
1717

1818
try:
19-
news = FeaturedArticlesSearch().sort("-date_published")[:limit].execute().hits.hits
19+
news = (
20+
FeaturedArticlesSearch().sort("-date_published")[:limit].execute().hits.hits
21+
)
2022
except Exception:
2123
news = []
2224

0 commit comments

Comments
 (0)