Issue #2 resolved

Nonexisten themes raise error.

pi11
repo owner created an issue

need to fix view with something like get_object_or_404

Traceback (most recent call last):

File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, callback_args, *callback_kwargs)

File "./flash/utils.py", line 22, in wrapper output = func(request, args, *kw)

File "./flash/views.py", line 87, in theme theme = Theme.objects.get(url__exact=theme_url)

File "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 132, in get return self.get_query_set().get(args, *kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 349, in get % self.model._meta.object_name)

DoesNotExist: Theme matching query does not exist.

<WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'CSRF_COOKIE': '98f0c07ace933e392e61eb0f039672d7', 'DOCUMENT_ROOT': '/var/www/dorgen/data/www/flashsex.ru/xxxflash', 'HTTP_ACCEPT': '/', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_COOKIE': '', 'HTTP_HOST': 'flashsex.ru', 'HTTP_REFERER': '', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13', 'PATH_INFO': u'/theme/pornholio/', 'QUERY_STRING': '', 'REMOTE_ADDR': '88.85.93.8', 'REMOTE_PORT': '7932', 'REQUEST_METHOD': 'HEAD', 'REQUEST_URI': '/theme/pornholio/', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'flashsex.ru', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'uwsgi.core': 1, 'uwsgi.version': '0.9.7.2', 'wsgi.errors': <open file 'wsgi_input', mode 'w' at 0x1ba4ed0>, 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>, 'wsgi.input': <open file 'wsgi_input', mode 'r' at 0x1ba4c00>, 'wsgi.multiprocess': True, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}>

Comments (1)

  1. Log in to comment