question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use user.get_id() instead of user.id

See original GitHub issue

https://github.com/mattupstate/flask-security/blob/a0e203774795f1bad289d76357237fcb604bfa01/flask_security/utils.py#L82

Isn’t the whole point of Flask-Login interface for get_id() to avoid calling an id attribute directly? I’m implementing a backend for Google datastore which does not have id attibute.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
jirikuncarcommented, Jun 23, 2017

@MartinMikita it would be easier if you provide the whole definition of your model.

Following example should work for you:

from sqlalchemy.orm import synonym

class User(db.Model, UserMixin):
    account_id = Column(...)
    ...

    id = synonym('account_id')

PS: I am trying to help you in my free time so be patient 😉

0reactions
sagard21commented, Jan 16, 2022
id = synonym('account_id')

Thank you for the synonym solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting the username instead of the user id - Yii2
You need the following relation in your code public function getUser(){ return $this->hasOne(User::className(), ['id' => 'user_id']); }.
Read more >
UserInfo.getUserId() returning null - Salesforce Developers
I am using String userid = UserInfo.getUserId() , but this is returning null for some reason. Any ideas why? Is it because I...
Read more >
Solved: How to get new user id added to the role from Proj...
I am using ProjectRoleUPdatedEvent to catch whenever a user is added to a project. Below is the code I am using. import com.atlassian.jira.event ......
Read more >
How to get user full name from user id - ServiceNow Community
Solved: In Performance analytic, I need to get the full name of the agent from the created_by field. And the script below doesn't...
Read more >
User Id from history xml providing DB user id - Forums - IBM
The history xml however provides the DB user id instead of the actual user name in MDMCE. ... User::getId(); get username: com.ibm.pim.organization.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found