Revision 85ae5a4c snf-astakos-app/astakos/api/quotas.py

b/snf-astakos-app/astakos/api/quotas.py
39 39
from snf_django.lib import api
40 40
from snf_django.lib.api.faults import BadRequest, ItemNotFound
41 41

  
42
from astakos.im.register import get_resources
42
from astakos.im import register
43 43
from astakos.im.quotas import get_user_quotas, service_get_quotas
44 44

  
45 45
import astakos.quotaholder_app.exception as qh_exception
......
52 52
@api.api_method(http_method='GET', token_required=True, user_required=False)
53 53
@user_from_token
54 54
def quotas(request):
55
    result = get_user_quotas(request.user)
55
    visible_resources = register.get_api_visible_resources()
56
    resource_names = [r.name for r in visible_resources]
57
    result = get_user_quotas(request.user, resources=resource_names)
56 58
    return json_response(result)
57 59

  
58 60

  
......
71 73

  
72 74
@api.api_method(http_method='GET', token_required=False, user_required=False)
73 75
def resources(request):
74
    result = get_resources()
76
    resources = register.get_api_visible_resources()
77
    result = register.resources_to_dict(resources)
75 78
    return json_response(result)
76 79

  
77 80

  

Also available in: Unified diff