Guest User

Untitled

a guest
Dec 15th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. def post_detail(request, slug=None):
  2. instance = get_object_or_404(Post, slug=slug)
  3. if instance.publish > timezone.now().date() or instance.draft:
  4. if not request.user.is_staff or not request.user.is_superuser:
  5. raise Http404
  6. share_string = quote_plus(instance.content)
  7.  
  8. ...
  9.  
  10. Traceback:
  11.  
  12. File "/Users/cward/projects/swanson_speech_therapy2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  13. 149. response = self.process_exception_by_middleware(e, request)
  14.  
  15. File "/Users/cward/projects/swanson_speech_therapy2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  16. 147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
  17.  
  18. File "/Users/cward/projects/swanson_speech_therapy2/blog/src/posts/views.py" in post_detail
  19. 49. share_string = quote_plus(instance.content)
  20.  
  21. File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py" in quote_plus
  22. 1308. s = quote(s, safe + ' ')
  23.  
  24. File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py" in quote
  25. 1303. return ''.join(map(quoter, s))
  26.  
  27. Exception Type: KeyError at /blog/test-8-9-10-11/
  28. Exception Value: u'u2019'
Add Comment
Please, Sign In to add comment