---

**[tickets:#8558] user email changes not getting into solr**

**Status:** open
**Milestone:** unreleased
**Created:** Thu Apr 25, 2024 04:58 PM UTC by Dave Brondsema
**Last Updated:** Thu Apr 25, 2024 04:58 PM UTC
**Owner:** nobody


For example, when a primary email address is deleted on a user, and one of 
their other emails becomes the primary, that doesn't get into solr.  So 
/nf/admin/search_users has old results

`IndexerSessionExtension` only indexes Users changes.  I think if an email 
address record is added or deleted, we probably want to trigger a user index 
then.

Also (and maybe even more importantly) the `user.set_pref('email_address', 
primary_addr)` call doesn't make `IndexerSessionExtension` do anything which is 
surprising since that is a field saved on the user record directly.  Need to 
figure out why.

minor, kinda related, I think this should be fixed:
```
--- Allura/allura/controllers/auth.py
+++ Allura/allura/controllers/auth.py
@@ -617,7 +617,7 @@ def _update_emails(self, user, admin=False, form_params={}):
                     flash('You must provide your current password to delete an 
email', 'error')
                     return
                 if primary_addr == user.email_addresses[i]:
-                    if select_new_primary_addr(user, 
ignore_emails=primary_addr) is None \
+                    if select_new_primary_addr(user, 
ignore_emails=[primary_addr]) is None \
                             and asbool(config.get('auth.require_email_addr', 
False)):
                         flash('You must have at least one verified email 
address.', 'error')
                         return
```




---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to