Revision 58350a50 snf-astakos-app/astakos/im/views/im.py
b/snf-astakos-app/astakos/im/views/im.py | ||
---|---|---|
903 | 903 |
super(MenuItem, self).__setattribute__(name, value) |
904 | 904 |
if name == 'current_path': |
905 | 905 |
self.__set_is_active__() |
906 |
|
|
907 |
|
|
908 |
def get_services(request): |
|
909 |
callback = request.GET.get('callback', None) |
|
910 |
mimetype = 'application/json' |
|
911 |
data = json.dumps(Service.catalog().values()) |
|
912 |
|
|
913 |
if callback: |
|
914 |
# Consume session messages. When get_services is loaded from an astakos |
|
915 |
# page, messages should have already been consumed in the html |
|
916 |
# response. When get_services is loaded from another domain/service we |
|
917 |
# consume them here so that no stale messages to appear if user visits |
|
918 |
# an astakos view later on. |
|
919 |
# TODO: messages could be served to other services/sites in the dict |
|
920 |
# response of get_services and/or get_menu. Services could handle those |
|
921 |
# messages respectively. |
|
922 |
messages_list = list(messages.get_messages(request)) |
|
923 |
mimetype = 'application/javascript' |
|
924 |
data = '%s(%s)' % (callback, data) |
|
925 |
|
|
926 |
return HttpResponse(content=data, mimetype=mimetype) |
Also available in: Unified diff