Commit dd2ff794 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Expose /user_catalogs service api call

Change migration scripts to use this instead of the user api call
parent a637b991
......@@ -40,7 +40,7 @@ from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils import simplejson as json
from . import render_fault, __get_uuid_displayname_catalog, __send_feedback
from . import render_fault, __get_uuid_displayname_catalogs, __send_feedback
from .faults import (
Fault, Unauthorized, InternalServerError, BadRequest, ItemNotFound)
from astakos.im.models import Service
......
......@@ -37,4 +37,5 @@ urlpatterns = patterns('',
(r'^im/', include('astakos.im.urls')),
(r'^login/?$', 'astakos.im.target.redirect.login'),
(r'^feedback/?$', 'astakos.im.api.user.send_feedback'),
(r'^user_catalogs/?$', 'astakos.im.api.user.get_uuid_displayname_catalogs'))
(r'^user_catalogs/?$', 'astakos.im.api.user.get_uuid_displayname_catalogs'),
(r'^service/api/user_catalogs/?$', 'astakos.im.api.service.get_uuid_displayname_catalogs'))
......@@ -54,12 +54,12 @@ def warn(*msgs):
get_displayname = functools.partial(astakos.get_displayname,
settings.CYCLADES_ASTAKOS_SERVICE_TOKEN,
url=settings.ASTAKOS_URL.replace('authenticate',
'service/api/v2.0/users'))
url=settings.ASTAKOS_URL.replace('im/authenticate',
'service/api/user_catalogs'))
get_user_uuid = functools.partial(astakos.get_user_uuid,
settings.CYCLADES_ASTAKOS_SERVICE_TOKEN,
url=settings.ASTAKOS_URL.replace('authenticate',
'service/api/v2.0/users'))
url=settings.ASTAKOS_URL.replace('im/authenticate',
'service/api/user_catalogs'))
def _validate_db_state(usernames):
......
......@@ -17,6 +17,8 @@ from synnefo.lib.astakos import get_user_uuid, get_displayname as get_user_displ
from pithos.api.settings import (
SERVICE_TOKEN, USER_CATALOG_URL, AUTHENTICATION_USERS)
USER_CATALOG_URL = USER_CATALOG_URL.replace('user_catalogs', 'service/api/user_catalogs')
import sqlalchemy as sa
catalog = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment