coffeestats / coffeestats-django

Django port of https://coffeestats.org/ code
Other
9 stars 2 forks source link

Wrong Error Message / Whoops! - If Input is not correct #26

Open swagner1981 opened 10 years ago

swagner1981 commented 10 years ago

Systems: Windows 8 Chrome Version 35.0.1916.153 m User is registered

Test Action: User is logged in User try to add coffee with wrong Time (22:91) manually in input field Error Messages is is shown (see attached Screen) Error Message said: "You can not enter dates in the future!" Then try to add the coffee in the past (yesterday - 22:91) Error Message said: "Whoops!"

coffeestats_org - coffeestats_org_profile - error_screenshot - wrong error message - chrome version 35 0 1916 153 m

jandd commented 10 years ago

corresponding traceback:

Traceback (most recent call last):

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/braces/views/_access.py", line 64, in dispatch
    request, *args, **kwargs)

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/views/generic/edit.py", line 170, in post
    if form.is_valid():

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/forms/forms.py", line 129, in is_valid
    return self.is_bound and not bool(self.errors)

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/forms/forms.py", line 121, in errors
    self.full_clean()

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/forms/forms.py", line 274, in full_clean
    self._clean_form()

  File "/home/jan/.virtualenvs/coffeestats/local/lib/python2.7/site-packages/django/forms/forms.py", line 300, in _clean_form
    self.cleaned_data = self.clean()

  File "./caffeine/forms.py", line 165, in clean
    self.cleaned_data['time'] is None

KeyError: 'time'

<WSGIRequest
path:/coffee/submit/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'date': [u'2014-07-04'], u'origin': [u'https://coffeestats.org/profile/'], u'csrfmiddlewaretoken': [u'bf9OqaXg82TBG4h0bdWHaKFrgLTHpQLS'], u'time': [u'07:61']}>,
COOKIES:{'_pk_id.8.0561': 'bfc4dbf4765d1445.1404588984.1.1404589142.1404588984.',
 'csrftoken': 'bf9OqaXg82TBG4h0bdWHaKFrgLTHpQLS',
 'sessionid': 'x92lzj1nhmcioowdpztu2zgmhgaixe1q'},
META:{'CONTENT_LENGTH': '131',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
 u'CSRF_COOKIE': u'bf9OqaXg82TBG4h0bdWHaKFrgLTHpQLS',
 'DOCUMENT_ROOT': '/etc/nginx/html',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
 'HTTP_ACCEPT_LANGUAGE': 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4',
 'HTTP_CACHE_CONTROL': 'max-age=0',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_LENGTH': '131',
 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'HTTP_COOKIE': 'sessionid=x92lzj1nhmcioowdpztu2zgmhgaixe1q; csrftoken=bf9OqaXg82TBG4h0bdWHaKFrgLTHpQLS; _pk_id.8.0561=bfc4dbf4765d1445.1404588984.1.1404589142.1404588984.',
 'HTTP_HOST': 'coffeestats.org',
 'HTTP_ORIGIN': 'https://coffeestats.org',
 'HTTP_REFERER': 'https://coffeestats.org/profile/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36',
 'PATH_INFO': u'/coffee/submit/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '87.157.54.152',
 'REMOTE_PORT': '50722',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/coffee/submit/',
 u'SCRIPT_NAME': u'',
 'SERVER_NAME': 'coffeestats.org',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'UWSGI_SCHEME': 'https',
 'uwsgi.core': 0,
 'uwsgi.node': 'web',
 'uwsgi.version': '1.2.3-debian',
 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x1c73780>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <uwsgi._Input object at 0x1a86070>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 0)}>