git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
88d1cf3
)
getAuthorities handling exception if no result from Registry platform
myslice-1.5
author
Loic Baron
<loic.baron@lip6.fr>
Wed, 17 Jun 2015 16:24:00 +0000
(18:24 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Wed, 17 Jun 2015 16:24:00 +0000
(18:24 +0200)
portal/actions.py
patch
|
blob
|
history
diff --git
a/portal/actions.py
b/portal/actions.py
index
ec4b288
..
523a9e1
100644
(file)
--- a/
portal/actions.py
+++ b/
portal/actions.py
@@
-84,12
+84,15
@@
def getAuthorities(request, admin = False):
# XXX theme has to be the same as the root authority
result = sfa_client(request,'List',hrn=theme.theme,object_type='authority',platforms=['myslice'],admin=admin)
authorities = list()
# XXX theme has to be the same as the root authority
result = sfa_client(request,'List',hrn=theme.theme,object_type='authority',platforms=['myslice'],admin=admin)
authorities = list()
- for item in result['myslice']:
- t_hrn = item['hrn'].split('.')
- if 'name' in item:
- authorities.append({'authority_hrn':item['hrn'], 'name':item['name'], 'shortname':t_hrn[-1].upper()})
- else:
- authorities.append({'authority_hrn':item['hrn']})
+ try:
+ for item in result['myslice']:
+ t_hrn = item['hrn'].split('.')
+ if 'name' in item:
+ authorities.append({'authority_hrn':item['hrn'], 'name':item['name'], 'shortname':t_hrn[-1].upper()})
+ else:
+ authorities.append({'authority_hrn':item['hrn']})
+ except:
+ logger.error(result)
return sorted(authorities)
return sorted(authorities)