Revision 0a444bb5 snf-pithos-app/pithos/api/delegate.py

b/snf-pithos-app/pithos/api/delegate.py
95 95
        return HttpResponse(status=e.reason)
96 96
    return HttpResponse()
97 97

  
98
def account_username(request):
99
    uuid = request.META.get('HTTP_X_USER_UUID')
100
    try:
101
        username =  get_username(
102
            SERVICE_TOKEN, uuid, USER_INFO_URL,
103
            AUTHENTICATION_USERS)
104
        return HttpResponse(content=username)
105
    except Exception, e:
106
        try:
107
            content, status = e.args
108
        except:
109
            content, status = e, 500
110

  
111
        return HttpResponse(status=status, content=content)

Also available in: Unified diff