<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>I synchronize users in my librecat system with our institutes
users by running a script that creates a users yaml file from
users pulled from a web service and then runs 'bin/librecat user
add /path/to/file.yml'. It first runs an export of the current
users to get the user ids of the existing users so my script can
add the ids to the users and have them update instead of a new
user create. An example of one of the user entries in the yaml
file is:</p>
<p> <font color="#999999">---<br>
_id: C77F1572-130C-11E8-AFB6-806D539212D2<br>
account_status: active<br>
date_created: 2018-02-16 11:38:27<br>
date_updated: 2018-02-16 11:38:27<br>
department:<br>
- {_id: CampIT}<br>
email: <a class="moz-txt-link-abbreviated" href="mailto:jnorris@ist.ac.at">jnorris@ist.ac.at</a><br>
first_name: Jonathan<br>
full_name: Jonathan Norris<br>
last_name: Norris<br>
login: jnorris<br>
password: sdjslkdjslkfjslkdjfslkdjfl<br>
photo:
<a class="moz-txt-link-freetext" href="https://icp.ist.ac.at/data/img/profile/medium/jnorris_uvGZW.jpg">https://icp.ist.ac.at/data/img/profile/medium/jnorris_uvGZW.jpg</a><br>
style: chicago<br>
super_admin: 1<br>
...</font></p>
<p>I update the users and everything works fine except that when I
see the list of accounts at '/admin/account/search' the updated
data is not reflected in the list. For example, I had a user who's
account was inactive and displaying the red inactivity tag in the
accounts list. Then I run the user sync script which updated the
user to have its account as active. But when I see the account in
the list the activity tag is still red and inactive. However when
I got to the edit form for that account the data is correctly
updated.</p>
<p>From the code it looks like it is pulling the list from the
database:</p>
<p><font color="#999999">=head2 GET /account/search<br>
<br>
Searches the authority database. Prints the search form + result
list.<br>
<br>
=cut<br>
<br>
get '/account/search' => sub {<br>
my $p = params;<br>
h->log->debug("query for researcher: " .
to_dumper($p));<br>
my $hits = LibreCat->searcher->search('user', $p);<br>
template 'admin/account', $hits;<br>
};</font></p>
<p>Could it be that when 'bin/librecat user add /path/to/file.yml'
is ran it is only updating the index and not the database? Is this
expected or should it update both the index and database?</p>
<p>When I run 'bin/librecat user get
A13E982A-1266-11E8-9236-8266539212D2' I get (account active):<br>
</p>
<p><font color="#999999">---<br>
_id: A13E982A-1266-11E8-9236-8266539212D2<br>
account_status: active<br>
date_created: 2018-02-15 15:41:03<br>
date_updated: 2018-02-28T10:20:06Z<br>
department:<br>
- _id: CaGu<br>
email: <a class="moz-txt-link-abbreviated" href="mailto:mstein@ist.ac.at">mstein@ist.ac.at</a><br>
first_name: Magdalena<br>
full_name: Magdalena Steinrück<br>
last_name: Steinrück<br>
login: mstein<br>
photo: <a class="moz-txt-link-freetext" href="https://icp.ist.ac.at/data/img/profile/medium/mstein.jpg">https://icp.ist.ac.at/data/img/profile/medium/mstein.jpg</a><br>
...</font><br>
</p>
<p>When I run 'bin/librecat user export
A13E982A-1266-11E8-9236-8266539212D2' I get (account inactive,
also old department):</p>
<p><font color="#999999">---<br>
_id: A13E982A-1266-11E8-9236-8266539212D2<br>
account_status: inactive<br>
date_created: 2018-02-15T15:41:03Z<br>
date_updated: 2018-02-15T15:41:03Z<br>
department:<br>
- _id: Guet<br>
email: <a class="moz-txt-link-abbreviated" href="mailto:mstein@ist.ac.at">mstein@ist.ac.at</a><br>
first_name: Magdalena<br>
full_name: Magdalena Steinrück<br>
last_name: Steinrück<br>
login: mstein<br>
photo: <a class="moz-txt-link-freetext" href="https://icp.ist.ac.at/data/img/profile/medium/mstein.jpg">https://icp.ist.ac.at/data/img/profile/medium/mstein.jpg</a><br>
...</font></p>
<p>Does 'get' take it from the index and 'export' take it from the
database?<br>
</p>
<p><br>
</p>
<p>Thanks for any insight,</p>
<p>Jonathan</p>
<p>IST Austria<br>
</p>
</body>
</html>