Skip to content

Commit

Permalink
Cleanup user controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoranPandovski committed May 29, 2017
1 parent a00ed4b commit 86dbd89
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ckanext/requestdata/controllers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,15 @@ def my_requested_data(self, id):
reverse = True
order = 'last_request_created_at'

for item in requests:
package = _get_action('package_show', {'id': item['package_id']})
count = _get_action('requestdata_request_data_counters_get',{'package_id':item['package_id']})
item['title'] = package['title']
item['shared'] = count.shared
item['requests'] = count.requests

#TODO simplify these
for item in requests:
package = _get_action('package_show', {'id': item['package_id']})
count = _get_action('requestdata_request_data_counters_get', {'package_id': item['package_id']})
package_maintainers_ids = package['maintainer'].split(',')
item['title'] = package['title']
item['shared'] = count.shared
item['requests'] = count.requests
maintainers = []
for i in package_maintainers_ids:
try:
Expand Down

0 comments on commit 86dbd89

Please sign in to comment.