summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author <bdauvergne@entrouvert.com>2009-09-21 13:10:10 (GMT)
committer <bdauvergne@entrouvert.com>2009-09-21 13:10:10 (GMT)
commit372fbc61682d8aa700d66f18654db4d9a755e5a5 (patch)
tree4d59b70e8306ab426bee8093ccbd4fee9b4a1bad
parent88d9977c2964f3d8e8604ca71f2ac811e65b98b4 (diff)
downloadpratic-372fbc61682d8aa700d66f18654db4d9a755e5a5.zip
pratic-372fbc61682d8aa700d66f18654db4d9a755e5a5.tar.gz
pratic-372fbc61682d8aa700d66f18654db4d9a755e5a5.tar.bz2
* do not fix cdg59metadataURL and cdg59URL when creating service instance of global services
* for service instances of global services, alway copy cdg59metadataURL and cdg59URL from the service_type object, not only when those field are undefined.
-rw-r--r--idp/extra/modules/directory.py18
-rw-r--r--idp/extra/modules/services_ui.ptl3
2 files changed, 8 insertions, 13 deletions
diff --git a/idp/extra/modules/directory.py b/idp/extra/modules/directory.py
index d3fd103..f106427 100644
--- a/idp/extra/modules/directory.py
+++ b/idp/extra/modules/directory.py
@@ -474,11 +474,10 @@ def get_service_instances(collectivity):
# fill missing fields for global services
services = get_services()
for si in service_instances:
- if not si.cdg59metadataURL and not si.cdg59URL:
- s = get_service(si.cdg59serviceType)
- if s and s.cdg59isGlobal:
- si.cdg59metadataURL = s.cdg59metadataURL
- si.cdg59URL = s.cdg59URL
+ s = get_service(si.cdg59serviceType)
+ if s and s.cdg59isGlobal:
+ si.cdg59metadataURL = s.cdg59metadataURL
+ si.cdg59URL = s.cdg59URL
return service_instances
@@ -491,11 +490,10 @@ def get_service_instance(collectivity, siid):
raise KeyError()
si = ServiceInstance(result[0])
# fix missing field values for global services
- if not si.cdg59metadataURL and not si.cdg59URL:
- s = get_service(si.cdg59serviceType)
- if s and s.cdg59isGlobal:
- si.cdg59metadataURL = s.cdg59metadataURL
- si.cdg59URL = s.cdg59URL
+ s = get_service(si.cdg59serviceType)
+ if s and s.cdg59isGlobal:
+ si.cdg59metadataURL = s.cdg59metadataURL
+ si.cdg59URL = s.cdg59URL
return si
diff --git a/idp/extra/modules/services_ui.ptl b/idp/extra/modules/services_ui.ptl
index f2f02ba..7145958 100644
--- a/idp/extra/modules/services_ui.ptl
+++ b/idp/extra/modules/services_ui.ptl
@@ -550,9 +550,6 @@ class ServicesDirectory(Directory):
si.cdg59siid = sid
si.cdg59serviceType = sid
associated_service = [x for x in all_services if x.cdg59sid == sid][0]
- if associated_service.cdg59isGlobal:
- si.cdg59metadataURL = associated_service.cdg59metadataURL
- si.cdg59URL = associated_service.cdg59URL
si.add(self.collectivity)