Fixes for review feedbacks
This commit is contained in:
parent
98bc9ea988
commit
ea5204d471
|
|
@ -18,8 +18,10 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import models
|
from . import models
|
||||||
|
# TODO when migrating to 12, fix the import of serv_config by renaming the
|
||||||
|
# file?
|
||||||
# Add an alias to access to the 'serv_config' module as it is shadowed
|
# Add an alias to access to the 'serv_config' module as it is shadowed
|
||||||
# the next line by an import of a variable with the same name.
|
# in the following line by an import of a variable with the same name.
|
||||||
# We can't change the import of serv_config for backward compatibility.
|
# We can't change the import of serv_config for backward compatibility.
|
||||||
from . import serv_config as server_env
|
from . import serv_config as server_env
|
||||||
from .serv_config import serv_config, setboolean
|
from .serv_config import serv_config, setboolean
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,11 @@ class ServerEnvMixin(models.AbstractModel):
|
||||||
:meth:`~_server_env_global_section_name`.
|
:meth:`~_server_env_global_section_name`.
|
||||||
|
|
||||||
For each field transformed to an env-computed field, a companion field
|
For each field transformed to an env-computed field, a companion field
|
||||||
``<field>_env_default`` is automatically created. When it's value is set
|
``<field>_env_default`` is automatically created. When its value is set
|
||||||
and the configuration files do not contain a key, the env-computed field
|
and the configuration files do not contain a key for that field, the
|
||||||
uses the default value stored in database. If a key is empty, the
|
env-computed field uses the default value stored in database. If there is a
|
||||||
env-computed field has an empty value.
|
key for this field but it is empty, the env-computed field has an empty
|
||||||
|
value.
|
||||||
|
|
||||||
Env-computed fields are conditionally editable, based on the absence
|
Env-computed fields are conditionally editable, based on the absence
|
||||||
of their key in environment configuration files. When edited, their
|
of their key in environment configuration files. When edited, their
|
||||||
|
|
@ -295,7 +296,7 @@ class ServerEnvMixin(models.AbstractModel):
|
||||||
is_editable_field = self._server_env_is_editable_fieldname(field)
|
is_editable_field = self._server_env_is_editable_fieldname(field)
|
||||||
for elem in view_arch.findall(field_xpath % field):
|
for elem in view_arch.findall(field_xpath % field):
|
||||||
# set env-computed fields to readonly if the configuration
|
# set env-computed fields to readonly if the configuration
|
||||||
# files have a key
|
# files have a key set for this field
|
||||||
elem.set('attrs',
|
elem.set('attrs',
|
||||||
str({'readonly': [(is_editable_field, '=', False)]}))
|
str({'readonly': [(is_editable_field, '=', False)]}))
|
||||||
if not view_arch.findall(field_xpath % is_editable_field):
|
if not view_arch.findall(field_xpath % is_editable_field):
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[external_service.ftp]
|
[external_service.ftp]
|
||||||
host = sftp.example.com
|
host = sftp.example.com
|
||||||
user = foo
|
user = foo
|
||||||
password = bar
|
password = bar
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue