Opened 15 years ago

Last modified 15 years ago

#194 closed defect (FIXED)

email validation assumes user is logged in

Reported by: Caleb Davis Owned by: Caleb Davis
Priority: minor Milestone: 0.0.5
Component: programming Keywords:
Cc: Parent Tickets:

Description

When the user clicks their email validation link, a userid and a token are sent in the querystring. However, in line 160 of mediagoblin/auth/views.py, we are redirecting according to the 'username' session variable.

If the user is not logged in, the following traceback ensues:

----------------------------------------
Exception happened during processing of request from ('50.15.244.85', 2850)
Traceback (most recent call last):
  File "/home/ubuntu/src/mediagoblin/eggs/Paste-1.7.5.1-py2.6.egg/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/home/ubuntu/src/mediagoblin/eggs/Paste-1.7.5.1-py2.6.egg/paste/httpserver.py", line 442, in handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/home/ubuntu/src/mediagoblin/eggs/Paste-1.7.5.1-py2.6.egg/paste/httpserver.py", line 437, in handle_one_request
    self.wsgi_execute()
  File "/home/ubuntu/src/mediagoblin/eggs/Paste-1.7.5.1-py2.6.egg/paste/httpserver.py", line 287, in wsgi_execute
    self.wsgi_start_response)
  File "/home/ubuntu/src/mediagoblin/eggs/Paste-1.7.5.1-py2.6.egg/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/home/ubuntu/src/mediagoblin/eggs/Beaker-1.5.4-py2.6.egg/beaker/middleware.py", line 152, in __call__
    return self.wrap_app(environ, session_start_response)
  File "/home/ubuntu/src/mediagoblin/mediagoblin/app.py", line 141, in __call__
    return controller(request)(environ, start_response)
  File "/home/ubuntu/src/mediagoblin/mediagoblin/auth/views.py", line 160, in verify_email
    user=request.user['username'])
TypeError: 'NoneType' object is unsubscriptable
----------------------------------------

Change History (3)

comment:1 by Caleb Davis, 15 years ago

Status: NewFeedback

username will be empty if the user is not logged in. It would be preferable to redirect in this line without depending on the session state

https://gitorious.org/mediagoblin/mediagoblin/merge_requests/15

comment:2 by Christopher Allan Webber, 15 years ago

Component: Programming
Status: FeedbackClosed

Merged! Thanks!

comment:3 by Will Kahn-Greene, 14 years ago

The original url for this bug was http://bugs.foocorp.net/issues/488 .

Note: See TracTickets for help on using tickets.