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

Fix profile page

parent 24e5c4e0
......@@ -35,7 +35,7 @@ from astakos.im.settings import (
IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL,
LOGIN_MESSAGES, SIGNUP_MESSAGES, PROFILE_MESSAGES,
GLOBAL_MESSAGES, PROFILE_EXTRA_LINKS)
from astakos.im.api import get_menu, get_services
from astakos.im.api import get_menu
from astakos.im.util import get_query
from astakos.im.auth_providers import PROVIDERS as AUTH_PROVIDERS
......@@ -107,11 +107,3 @@ def menu(request):
return {}
else:
return {'menu': menu_items}
def services(request):
try:
resp = get_services(request)
except Exception, e:
return {}
else:
return {'services': json.loads(resp.content)}
......@@ -58,7 +58,6 @@ context_processors = [
'astakos.im.context_processors.code',
'astakos.im.context_processors.invitations',
'astakos.im.context_processors.menu',
'astakos.im.context_processors.services',
'astakos.im.context_processors.custom_messages',
'astakos.im.context_processors.last_login_method',
'synnefo.lib.context_processors.cloudbar'
......
......@@ -66,6 +66,7 @@ from django.template.loader import render_to_string
from django.views.decorators.http import require_http_methods
from django.db.models import Q
from django.core.exceptions import PermissionDenied
from django.utils import simplejson as json
import astakos.im.messages as astakos_messages
......@@ -99,6 +100,7 @@ from astakos.im.settings import (
LOGGING_LEVEL, PAGINATE_BY,
RESOURCES_PRESENTATION_DATA, PAGINATE_BY_ALL,
MODERATION_ENABLED)
from astakos.im.api import get_services
from astakos.im import settings as astakos_settings
from astakos.im.api.callpoint import AstakosCallpoint
from astakos.im import auth_providers
......@@ -397,6 +399,13 @@ def edit_profile(request, template_name='im/profile.html', extra_context=None):
# providers that user can add
user_available_providers = request.user.get_available_auth_providers()
try:
resp = get_services(request)
except Exception, e:
services = ()
else:
services = json.loads(resp.content)
extra_context['services'] = services
return render_response(template_name,
profile_form = form,
user_providers = user_providers,
......
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