File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change
1
+ """Endpoints accessible via the CERN Open Data Portal API."""
Original file line number Diff line number Diff line change 1
- """News endpoint accessible via the CERN Open Data Portal API"""
1
+ """News endpoint accessible via the CERN Open Data Portal API. """
2
2
3
3
from datetime import datetime
4
4
11
11
12
12
@blueprint .route ("/news.xml" , methods = ["GET" ])
13
13
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 )
16
16
limit = min (abs (limit ), 128 )
17
17
18
18
try :
19
- news = FeaturedArticlesSearch ().sort ("-date_published" )[:limit ].execute ().hits .hits
19
+ news = (
20
+ FeaturedArticlesSearch ().sort ("-date_published" )[:limit ].execute ().hits .hits
21
+ )
20
22
except Exception :
21
23
news = []
22
24
You can’t perform that action at this time.
0 commit comments