Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from bartmika/master
Added reverse for tenants. #87
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0c1c137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone curious to redirect to a different tenant you will do:
return redirect(target_tenant.reverse(request, 'view_name'))
Yes, it's right above in the commit, but I searched for this for far too long so I figured it'd be best to include here :)
Use Case:
You allow the users to log in on the public tenant and want to direct to their personal tenant URL on authentication of the user. You just need to retrieve the object of the target_tenant and get the reverse of it. Rather simple though it flew over my head for a few minutes.
Thank you for this addition, was really helpful!