magfest / ubersystem

MAGFest's Ubersystem - handles ticketing, staffing, analytics, volunteers, and tons more
http://magfest.org
GNU Affero General Public License v3.0
48 stars 55 forks source link

need better error message when using invalid attendee UUID #1564

Open binary1230 opened 8 years ago

binary1230 commented 8 years ago

Example: https://prime.uber.magfest.org/uber/registration/form?id=ffffffff-ffff-ffff-ffff-ffffffffffff

Expected: error message that says "This attendee does not exist, invalid UUID"

Actual: Slightly obscure non-obvious traceback:

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/usr/local/uber/env/lib/python3.4/site-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/local/uber/env/lib/python3.4/site-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/uber/env/lib/python3.4/site-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 179, in with_timing
    return func(*args, **kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 170, in with_caching
    return func(*args, **kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 194, in with_session
    retval = func(*args, session=session, **kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 278, in with_restrictions
    return func(*args, **kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 240, in with_rendering
    result = func(*args, **kwargs)
  File "/usr/local/uber/plugins/uber/uber/decorators.py", line 13, in with_check
    sa.Tracking.track_pageview(cherrypy.request.path_info, cherrypy.request.query_string)
  File "/usr/local/uber/plugins/uber/uber/models.py", line 1730, in track_pageview
    Tracking.track(c.PAGE_VIEWED, attendee)
  File "/usr/local/uber/plugins/uber/uber/models.py", line 1691, in track
    data = 'id={}'.format(instance.id)
AttributeError: 'NoneType' object has no attribute 'id'
binary1230 commented 8 years ago

found this when clicking on an attendee added to the watchlist that we later deleted or something. bug happens on any valid hexstring that doesn't map to a real user.