GithubHelp home page GithubHelp logo

Comments (8)

orf avatar orf commented on May 17, 2024 2

I've made a ticket on the Django bug tracker: https://code.djangoproject.com/ticket/27542#ticket

PR #47 adds a note to the readme about this.

from django-rules.

blueyed avatar blueyed commented on May 17, 2024

I think you are meant to pass in an explicit backend, if the first one does not work. Closing.

Django code reference: https://github.com/django/django/blob/59bbacf88db1b533ae05ea38e01b5e1ec9f59622/django/test/client.py#L628-L632

from django-rules.

orf avatar orf commented on May 17, 2024

I think this should be added to the documentation, this is quite confusing.

from django-rules.

blueyed avatar blueyed commented on May 17, 2024

@orf
Please consider creating a PR then.

from django-rules.

dfunckt avatar dfunckt commented on May 17, 2024

Reopening to have the issue as a reminder to investigate whether adding get_user to the backend breaks other stuff, as that would be the proper "fix" here.

from django-rules.

orf avatar orf commented on May 17, 2024

I don't think that's a good idea, I think it's a Django problem. Instead of blindly getting the first auth backend it should be a little smart and skip ones without a get_user.

from django-rules.

dfunckt avatar dfunckt commented on May 17, 2024

Hmm, yeah, I went through Django's code and it seems it's not a good idea -- you'd force_login a user but you'd later get AnonymousUser back instead, if the backend's get_user method returned None (as rules' one would).

Agreed, the proper way forward is documenting it here and raising an issue with Django.

from django-rules.

blueyed avatar blueyed commented on May 17, 2024

Awesome, it got fixed in Django: django/django@47744a0.
Let's close it here then.

from django-rules.

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.