Skip to content

Commit

Permalink
Merge pull request #6053 from manics/omero•web•client•settings
Browse files Browse the repository at this point in the history
OMERO.web client settings override server client settings
  • Loading branch information
joshmoore authored Jul 3, 2019
2 parents 424711c + 45e1c8e commit bf319d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/tools/OmeroPy/src/omero/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ def _check(msg, vers):
vers = popen.communicate()[1]
_check("icegridnode version", vers)

def open_config(self, unused):
def open_config(self, unused=None):
"""
Callers are responsible for closing the
returned ConfigXml object.
Expand Down
17 changes: 17 additions & 0 deletions components/tools/OmeroWeb/omeroweb/webclient/webclient_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

from omero.gateway import KNOWN_WRAPPERS

from omero.plugins.admin import AdminControl

from django.utils.encoding import smart_str
from django.conf import settings

Expand Down Expand Up @@ -239,6 +241,21 @@ def chgrpDryRun(self, targetObjects, group_id):
##############################################
# IAdmin ##

def getClientSettings(self):
"""
Returns all client properties matching omero.client.*
Local config settings override client settings sent by the server
"""
configmap = super(OmeroWebGateway, self).getClientSettings()
localcfg = AdminControl().open_config()
try:
for key in localcfg.keys():
if key.startswith('omero.client.'):
configmap[key] = localcfg[key]
return configmap
finally:
localcfg.close()

def getEmailSettings(self):
"""
Retrieves a configuration value "omero.mail.config" from the backend
Expand Down

0 comments on commit bf319d3

Please sign in to comment.