You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're now having discussions about this in three different places, so creating issue just for this.
I think this comment from Seb and subsequent discussion is critical:
@sphuber would you mind taking a look if the changes here make sense? I am not super familiar in how aiida-core handles User instances.
I had a look but I don't understand what the changes to fetching the default user should do. First of, User.objects is deprecated, and User.collection should be used instead. So the PR changes to use the deprecated version. The current use is correct. To get the default user, User.collection.get_default() is correct. The only tricky part here is that this default is cached on the StorageBackend. So if the default user is changed, this needs to be reset through StorageBackend.reset_default_user. This is done automatically through Manager.set_default_user_email but not if you go directly through Profile.set_default_user_email.
If you want to manually query for a user given an email, I would recommend User.collection.get(email='email'). It is concise and closest in syntax to User.colelction.get_default()
Is seems to me that using StorageBackend.reset_default_user could be used to get rid of the cached User instance, before setting up the codes.
The text was updated successfully, but these errors were encountered:
We're now having discussions about this in three different places, so creating issue just for this.
I think this comment from Seb and subsequent discussion is critical:
Is seems to me that using
StorageBackend.reset_default_user
could be used to get rid of the cached User instance, before setting up the codes.The text was updated successfully, but these errors were encountered: