-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
instance.admin.(email for example) returns the last user created #18
Comments
thanks for spotting that; back in the day the instance admin was a total hack which was just finding a random account with a matching domain. I suspect that logic is still lurking around. |
I was under the impression the gorm magic wasn't working as before adding a LocalUser account, the correct info were returned but if you think that's "intentional", I'm gonna find this culprit ;) |
@davecheney I hope my PR will satisfy you ; I was really frustrated by this problem. I found 2 other occurrences (hoping I caught them all.) Something puzzles me though: gorm documentation describes
as a Belongs To association, "the instance belongs to the admin account". Shouldn't this be instead an Has One, "the instance has one admin account"? If so, one should take a look the the many associations in your schema. my 2¢ |
Damnit, did I break that again? |
It never worked (I found this when I first played with pub) as it never could (and I bet that's also true with Relationship & Status.) Regarding BelongsTo vs HasOne, I don't know if that changes anything today but isn't this a bet that gorm won't do things differently in the future? |
I get very confused by HasOne vs BelongsTo in gorm. |
you, me and a million people. |
Hi,
That's probably a "gorm magic" issue and I really have no idea how to solve it. Check my test server (https://none.com/api/v1/instance/). You'll see that email, contact_account is myself although the serializer processes the i.Admin (admin@).
When I check instances and accounts in Mariadb, this confirms that it holds the right info (see below).
Any hint/solution would be great.
thank you.
Frédéric
The text was updated successfully, but these errors were encountered: