| |
@@ -38,8 +38,9 @@
|
| |
|
| |
prs = dashboard_user_data_prs(user)
|
| |
bzs = dashboard_user_data_bzs(user)
|
| |
+ package_versions = dashboard_user_data_pkg_versions(user)
|
| |
|
| |
- return jsonify({'static_info': static_info, 'prs': prs, 'bzs': bzs})
|
| |
+ return jsonify({'static_info': static_info, 'prs': prs, 'bzs': bzs, 'package_versions': package_versions})
|
| |
|
| |
|
| |
def dashboard_user_data_static(user):
|
| |
@@ -68,6 +69,22 @@
|
| |
}
|
| |
|
| |
|
| |
+ def dashboard_user_data_pkg_versions(user):
|
| |
+ data = CACHE.async_get('packager-dashboard_user_data_static', 'low', user)
|
| |
+ if data in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
+ return {"status": 204, "data": None}
|
| |
+
|
| |
+ status = 200
|
| |
+ package_versions = {}
|
| |
+ for package in data["packages"]:
|
| |
+ item = CACHE.async_get('packager-dashboard_package_versions', 'low', package)
|
| |
+ if item not in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
+ package_versions[package] = item
|
| |
+ else:
|
| |
+ package_versions[package] = {}
|
| |
+ status = 202
|
| |
+ return {"status": status, "data": package_versions}
|
| |
+
|
| |
def dashboard_user_data_prs(user):
|
| |
data = CACHE.async_get('packager-dashboard_user_data_static', 'low', user)
|
| |
if data in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
@@ -76,9 +93,9 @@
|
| |
status = 200
|
| |
pull_requests = {}
|
| |
for package in data["packages"]:
|
| |
- data = CACHE.async_get('packager-dashboard_pull_requests', 'low', package)
|
| |
- if data not in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
- pull_requests[package] = data
|
| |
+ item = CACHE.async_get('packager-dashboard_pull_requests', 'low', package)
|
| |
+ if item not in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
+ pull_requests[package] = item
|
| |
else:
|
| |
pull_requests[package] = []
|
| |
status = 202
|
| |
@@ -93,9 +110,9 @@
|
| |
status = 200
|
| |
bugzillas = {}
|
| |
for package in data["packages"]:
|
| |
- data = CACHE.async_get('packager-dashboard_bugs', 'low', package)
|
| |
- if data not in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
- bugzillas[package] = data
|
| |
+ item = CACHE.async_get('packager-dashboard_bugs', 'low', package)
|
| |
+ if item not in [cache_utils.RefresherNotRegistered, cache_utils.AsyncRefreshInProgress]:
|
| |
+ bugzillas[package] = item
|
| |
else:
|
| |
bugzillas[package] = []
|
| |
status = 202
|
| |
Fixes https://pagure.io/fedora-qa/packager_dashboard/issue/24 in the backend side.