Corvia / django-tenant-users

Adds global user authentication and tenant-specific permissions to django-tenants.
https://django-tenant-users.rtfd.io
MIT License
333 stars 64 forks source link

Middleware module is absent on the installable package. #597

Closed sbonelo-nje closed 3 months ago

sbonelo-nje commented 3 months ago

Going through the docs to configure dtu, the docs mention the TenantAccessMiddleware. Looking at the source code, it looks as the middleware is the one that handles granting/denying access to the global user on a tenant.

Installing the package following the docs and setting up the middleware raises a ModuleNotFoundError for the middleware module.

Taking a look at the libs in the venv, the middleware is indeed missing from the dtu package and it seems it has not really been in the package since the beginning (the previous releases all are the module as well).

The test app on the repo also does not have the middleware installed, not sure whether this is related to the module itself missing from the distrubuted versions and is intentional or some other reason is there.

Expected Behavior

Upon following the docs to install dtu, everything should proceed to work fine.

Actual Behavior

A ModuleNotFoundError is raised for the middleware module.

Possible Fix

Including the module in the released distributions.

Steps to Reproduce

Your Environment

Relevant details about the environment I experienced the bug in.

sbonelo-nje commented 3 months ago

Going through the pull requests, I realize that the middleware was recently introduced on this #808d1d1 pull.

I'm still not sure how it is being missed when the distribution is being compiled?

UPDATE : Silly me! The update is only a few days old in the repo, no release has been made that includes the middleware 😅.

I have a new question now, when can we expect a new release?

Dresdn commented 3 months ago

I haven't done a release yet, but I can do one now. The process is manual as we don't have an automatic release job.

If you're installing from git, yes, it should be there. Otherwise, gimme a min and I'll put out a new version.

sbonelo-nje commented 3 months ago

Greatly appreciated 👏🙏 @Dresdn