Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2104 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

tg.url missing in tg.devtools templates ?

Reported by: lszyba1 Owned by: faide
Priority: normal Milestone: 2.0b1
Component: TurboGears Version: trunk
Severity: blocker Keywords:
Cc:

Description

Follow up on 2033 ticket after new template added to trunk.

The new template in tg.devtools is missing few tg.url. I'm attaching a patch to fixes it in templates (see tickiet2033)(http://trac.turbogears.org/attachment/ticket/2033/login_handler.diff) but after a user logs in the page gets redirected to '/' instead of tg.url('/'). I cannot find where in the code the process gets redirected. The logout button seem to redirect at the end to /login?came_from instead of tg.url('/login')?came_from.

I've been told this happens in repoze.what/who which means it is incorrectly redirecting but I'm not sure where that code is.

Lucas

Attachments

login_handler.diff Download (2.8 KB) - added by lszyba1 10 years ago.
login_fix.diff Download (935 bytes) - added by lszyba1 10 years ago.
Fix for login, this will fix redirection for login

Change History

comment:1 Changed 10 years ago by faide

can you try from the latest trunk ?

comment:2 Changed 10 years ago by lszyba1

This was tested on Friday dec 19th. I won't be able to check until end of day today. If you have made changes after Friday night, I will have to check tonight.

Lucas

Changed 10 years ago by lszyba1

comment:3 Changed 10 years ago by faide

  • Summary changed from tg2 not wsgi compliant with public/static content and identity to tg.url missing in tg.devtools templates ?

setting new subject since this as nothing not do with WSGI compliance and more with "broken" html templates.

comment:4 Changed 10 years ago by lszyba1

In addition to the missing tg.url() in quick started template the login logout doesn't seem to redirect properly.

print devtools.file

/usr/local/pythonenv/BASELINE6/lib/python2.5/site-packages/tg.devtools-2.0b1dev_r5976-py2.5.egg/devtools/init.pyc

When using modwsgi I set the script name like this: WSGIScriptAlias /mainweb /path/to/myapp/mainweb.wsgi

What above does is set script_name for tg2 app. script_name = /mainweb

This script name is not used after I click "login" or "logout"  http://localhost/mainweb/login I fill in user:pass and when I click login, I am redirected to:  http://localhost/ instead I should be redirected to  http://localhost/mainweb/

Similar situation happens on logout:  http://localhost/login?came_from=http%3A%2F%2Flocalhost%2Fmainweb%2F instead of  http://localhost/mainweb/login?came_from=http%3A%2F%2Flocalhost%2Fmainweb%2F

If you could tell me which part of the tg2 quick started app this happens in then maybe I can fix it or point you to exactly where it fails.

I think in a previous version the logon would work like this:  http://localhost/mainweb/login this would required login and pass.

After you login the def login(self):

would be used to redirect to proper place by using raise or return self.index. Currently the redirect to '/' is hidden or is in some unknown place.

Let me know, Thanks, Lucas

Changed 10 years ago by lszyba1

Fix for login, this will fix redirection for login

comment:5 Changed 10 years ago by lszyba1

I've attached a fix for login redirection. I am not able to locate the /logout_handler which is used at the logout button.

Lucas

comment:6 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed

This seems to be fixed everywhere. Logout is a separate issue and I'll create a separate ticket for it.

comment:7 Changed 10 years ago by lszyba1

It seems you didn't apply the login_fix.diff or you will move it to a new ticket?

login_fix.diff fixed the root.py template and login redirection.

Lucas

Note: See TracTickets for help on using tickets.