Skip to content

Commit 900715c

Browse files
authored
fix #2773 (#2993)
* fix #2773 * addressing @ElDeveloper comment
1 parent 5a23e49 commit 900715c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

qiita_pet/handlers/qiita_redbiom.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
import redbiom._requests
1414
import redbiom.util
1515
import redbiom.fetch
16+
import redbiom.admin
1617
from tornado.gen import coroutine, Task
1718
from tornado.web import HTTPError
19+
from requests.exceptions import HTTPError as rHTTPError
1820

1921
from qiita_core.util import execute_as_transaction
2022
from qiita_db.util import generate_study_list_without_artifacts
@@ -27,9 +29,18 @@ class RedbiomPublicSearch(BaseHandler):
2729
def get(self, search):
2830
# making sure that if someone from a portal forces entry to this URI
2931
# we go to the main portal
32+
try:
33+
timestamps = redbiom.admin.get_timestamps()
34+
except (rHTTPError):
35+
timestamps = []
36+
37+
if timestamps:
38+
latest_release = timestamps[0]
39+
else:
40+
latest_release = 'Not reported'
3041
if self.request.uri != '/redbiom/':
3142
self.redirect('/redbiom/')
32-
self.render('redbiom.html')
43+
self.render('redbiom.html', latest_release=latest_release)
3344

3445
def _redbiom_metadata_search(self, query, contexts):
3546
study_artifacts = defaultdict(lambda: defaultdict(list))

qiita_pet/templates/redbiom.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
{%block content%}
181181
<small>
182182
<!-- Date to be fixed once we fix: https://github.com/biocore/qiita/issues/2773 -->
183-
Redbiom only searches on public data. Last update: December 18th, 2018. Note that you will only be able to expand and add artifacts to analyses if you are signed into Qiita.
183+
Redbiom only searches on public data. Last update: <i>{{latest_release}}</i>. Note that you will only be able to expand and add artifacts to analyses if you are signed into Qiita.
184184
<br/><br/>
185185
<a href="{% raw qiita_config.portal_dir %}/static/doc/html/redbiom.html" class="btn btn-info btn-sm" target="_blank">Help and examples?</a>
186186
<br/>

0 commit comments

Comments
 (0)