If more then two email addresses are defined in the user settings, it was not possible to change the default address to one of those additional addresses.
This was caused by the frontend, all addresses got the same html 'form-id', that way always the first one was submitted when clicking the submit button, independent of the actual selected email address.
Resolved by adding a random number as suffix to the 'form-id' of each email address, that way there are unique and the default mail address can be changed even with more then two assigned addresses.
Fixes: https://pagure.io/pagure/issue/5327
Fixes: https://pagure.io/pagure/issue/5338
Is it only possible to have 255 email addresses? I mean, it's a high number and unlikely to be hit, but I have to ask. :laughing: