As we have a consortium and sometimes users are changing institutes and also their mail addresses, we need to be able to update them automatically.
The best way would be, that it is updated when the user is signing in.
Hi Adrian, where the script need to be executed? I run command python sync_user_email.py but obtain follow error:
Traceback (most recent call last):
File "sync_user_email.py", line 23, in <module>
with make_app().app_context():
File "/usr/lib/python2.7/site-packages/indico/web/flask/app.py", line 347, in make_app
app.config['INDICO'] = load_config(only_defaults=testing, override=config_override)
File "/usr/lib/python2.7/site-packages/indico/core/config.py", line 200, in load_config
path = get_config_path()
File "/usr/lib/python2.7/site-packages/indico/core/config.py", line 146, in get_config_path
'move/symlink the config in one of the following locations: {}'.format(', '.join(paths)))
Exception: No indico config found. Point the INDICO_CONFIG env var to your config file or move/symlink the config in one of the following locations: /root/.indico.conf, /etc/indico.conf
Point the INDICO_CONFIG env var to your config file or move/symlink the config in one of the following locations: /root/.indico.conf, /etc/indico.conf
The problem is that you are running this script as root, and not as the indico user where it will just work…
PS: I guess you are not using the standard setup structure since you have Indico in your system environment instead of the /opt/indico/.venv virtualenv? In any case, you need to run it as the user used for Indico, and if you do not have a ~/.indico.conf symlink pointing to your actual indico.conf, then you need to use the INDICO_CONFIG env var to point to it.
I follow your suggestions, so I run the script under indico user and in .venv virtualenv where I have .indico.conf but I obtain this:
(.venv)[indico@indicohost2 ~]$ python2.7 sync_user_email.py
/opt/indico/.venv/lib/python2.7/site-packages/indico/core/auth.py:72: UserWarning: There is no default group provider but you have providers with group support. This will break legacy ACLs referencing external groups and room ACLs will use local group IDs.
warn('There is no default group provider but you have providers with group support. '
Traceback (most recent call last):
File "sync_user_email.py", line 24, in <module>
for user in User.query.filter_by(is_deleted=False):
NameError: name 'User' is not defined
Adrian I ran the script without any (visible) error but the email is always the same on a couple of users who changed their address a week ago on our Active Directory. I tried to restart the Indico services and also the command indico user search -e ‘@’ --substring returns old values. any ideas?