Giter VIP home page Giter VIP logo

Comments (3)

radusuciu avatar radusuciu commented on August 27, 2024

What datastore are you using? My guess is code like this is responsible: https://github.com/mattupstate/flask-security/blob/develop/flask_security/datastore.py#L242-L249

if self._is_numeric(identifier):
    return user_model_query.get(identifier)
for attr in get_identity_attributes():
    query = alchemyFn.lower(getattr(self.user_model, attr)) \
        == alchemyFn.lower(identifier)
    rv = user_model_query.filter(query).first()
    if rv is not None:
        return rv

from flask-security.

manganmus avatar manganmus commented on August 27, 2024

I have the same problem - when trying to login (or register a new user), I get "Model.UserDoesNotExist - instance matching query does not exist" . Debug message shows the query is filtering on user.id = the email address given in get_user(). I'm using Peewee for the datastore. Is there a fix for this?

from flask-security.

jwag956 avatar jwag956 commented on August 27, 2024

I am not sure in 3.0.0 - but in my fork - this should be fixed in 3.4.4:
https://pypi.org/project/Flask-Security-Too/

If you try Flask-Security-Too - make sure you follow the quick start guide - in particular:

    # we need the one from UserMixin.
    class User(UserMixin, db.Model):

i.e. the order of inheritence/mixin is important.

from flask-security.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.