Fix API key generation with LDAP
Fix API key generation with LDAP

* Only generate on first login, not every login
* Handle case where user has not yet been saved

artefactual/archivematica,artefactual/archivematica,artefactual/archivematica,artefactual/archivematica