Revision 19246578

b/docs/astakos-api-guide.rst
346 346
|
347 347

  
348 348
The request body is a json formatted dictionary containing a list with uuids and another list of displaynames to translate.
349
If instead of list null is passed then the response contains the information for all the system users (For discretion purposes
350
this behavior is **not** exposed in the respective call of the User API).
349 351

  
350 352
Example request content:
351 353

  
b/snf-astakos-app/astakos/im/api/__init__.py
42 42
from django.utils.translation import ugettext as _
43 43

  
44 44
from astakos.im.models import AstakosUser, Service, Resource
45
from astakos.im.api.faults import Fault, ItemNotFound, InternalServerError, BadRequest
45
from astakos.im.api.faults import (
46
    Fault, ItemNotFound, InternalServerError, BadRequest)
46 47
from astakos.im.settings import (
47 48
    INVITATIONS_ENABLED, COOKIE_NAME, EMAILCHANGE_ENABLED, QUOTAHOLDER_URL)
48 49
from astakos.im.forms import FeedbackForm
......
138 139
                       url=absolute(request, reverse('invite')),
139 140
                       name="Invitations"))
140 141

  
141
            
142

  
142 143
            append(item(
143 144
                   url=absolute(request, reverse('resource_usage')),
144 145
                   name="Usage"))
......
203 204
        if name == 'current_path':
204 205
            self.__set_is_active__()
205 206

  
206
def __get_uuid_displayname_catalogs(request):
207
def __get_uuid_displayname_catalogs(request, user_call=True):
207 208
    # Normal Response Codes: 200
208 209
    # Error Response Codes: badRequest (400)
209 210

  
......
213 214
        raise BadRequest('Request body should be json formatted.')
214 215
    else:
215 216
        uuids = input_data.get('uuids', [])
217
        if uuids == None and user_call:
218
            uuids = []
216 219
        displaynames = input_data.get('displaynames', [])
220
        if displaynames == None and user_call:
221
            displaynames = []
217 222
        d  = {'uuid_catalog':AstakosUser.objects.uuid_catalog(uuids),
218 223
              'displayname_catalog':AstakosUser.objects.displayname_catalog(displaynames)}
219 224

  
b/snf-astakos-app/astakos/im/api/service.py
88 88
    #                       badRequest (400)
89 89
    #                       unauthorised (401)
90 90

  
91
    return __get_uuid_displayname_catalog(request)
91
    return __get_uuid_displayname_catalogs(request, user_call=False)
92 92

  
93 93
@csrf_exempt
94 94
@api_method(http_method='POST', token_required=True)

Also available in: Unified diff