carlxaeron / django-rosetta

Automatically exported from code.google.com/p/django-rosetta
MIT License
0 stars 0 forks source link

Wrong redirection to login form #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If user isn't authenticated and access to rosetta pages then should be 
redirected to admin login not /accounts/login/?next=...

Original issue reported on code.google.com by vsto...@gmail.com on 12 May 2008 at 12:18

GoogleCodeExporter commented 8 years ago
As far as I know, it's not possible to piggyback django.contrib.admin's login 
method and get successfully 
redirected back. 

Also, since the admin is not strictly required to run Rosetta, we would have to 
play some wicked tricks here. All 
in all I'm not quite in favor of doing this.

Feel free to send in a patch and I'll gladly reconsider this, though :)

Original comment by mbonetti on 12 May 2008 at 1:56

GoogleCodeExporter commented 8 years ago
For example you can provide login_url parameter for decorator like:
@user_passes_test(lambda user:can_translate(user), 
login_url=settings.ROSETTA_LOGIN_URL)

Original comment by vsto...@gmail.com on 12 May 2008 at 2:21

GoogleCodeExporter commented 8 years ago
Yes, I saw the login_url argument, still this would require the user to specify 
the URL in his settings file, which 
again breaks the whole application independence.

And again, even if you define settings.ROSETTA_LOGIN_URL to be e.g. '/admin/' 
there is no trivial method to 
redirect back to rosetta, after a successful login on the admin.

Original comment by mbonetti on 12 May 2008 at 5:22

GoogleCodeExporter commented 8 years ago
Redirect back after login is covered by decorator through next param 
automaticaly.

I think it make sense to expect that in application where is rosetta used is 
used by 
admins (superuser is required for rosetta or translate group) then common 
users. 
Even after editing .po files you must restart web server.

Now it redirects to application login page as if it expects that every web has 
accounts login page which is designated for login of public users.

I wouldn't be afraid to fit rosetta with admin more nicely. For example 
extending 
admin templates rather than provide own base templates which are designed 
similar to 
admin but have differences which are little anoying when one tries to use 
rosetta in 
backend.

Who wants use rosetta anywhere outside admin in some other design context, he 
will 
be anyway creating all templates by himself.

Original comment by vsto...@gmail.com on 12 May 2008 at 5:51