Custom Query (1173 matches)
Results (145 - 147 of 1173)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #5419 | fixed | Settle on a local development server for both Python 3 and Python 2 | ||
| Description |
We need a local development server that works on *both* Python 2 and Python 3. gunicorn is a likely candidate since we kind of used this for Python 3 before. Paste is not an option at this time of writing and it doesn't make sense for us to have two different strategies... we should unify. |
|||
| #5416 | fixed | FileObjectAwareFile breaking test in Python 3, doesn't know how to write unicode strings | ||
| Description |
Commit 2b4c339d very nicely fixed #647, though some of our tests write strings manually, and in Python 3, this is very specifically a bytes object, not a string object. As such, this test is breaking: _______________________ TestDecodeRequest.test_json_type _______________________
Traceback (most recent call last):
File "/home/cwebber/devel/mediagoblin/mediagoblin/tests/test_tools.py", line 40, in test_json_type
data = decode_request(request)
File "/home/cwebber/devel/mediagoblin/mediagoblin/tools/request.py", line 68, in decode_request
data = json.loads(data)
File "/gnu/store/awss99f2wql2h55wqjycvhnvsqpjfqsc-python-3.4.3/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
|
|||
| #5415 | fixed | Server error when trying to access media with graveyards comments | ||
| Description |
As a logged in user, if I try to access a media page with a graveyard comment, I get a server error with the text below in my log. If I'm not logged in, then the comments aren't displayed, so the error doesn't occur. Error - <class 'jinja2.exceptions.UndefinedError'>: 'mediagoblin.db.models.Graveyard object' has no attribute 'get_actor'
URL: https://goblinrefuge.com/mediagoblin/u/sushibsd/m/dank-wats/
File '/path/to/mediagoblin/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/exceptions/errormiddleware.py', line 144 in __call__
app_iter = self.application(environ, sr_checker)
File '/path/to/mediagoblin/mediagoblin/app.py', line 342 in __call__
return self.call_backend(environ, start_response)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Werkzeug-0.10.1-py2.7.egg/werkzeug/wsgi.py', line 591 in __call__
return self.app(environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 276 in call_backend
return self._finish_call_backend(request, environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 318 in _finish_call_backend
response = controller(request)
File '/path/to/mediagoblin/mediagoblin/decorators.py', line 47 in wrapper
return controller(request, *args, **kwargs)
File '/path/to/mediagoblin/mediagoblin/decorators.py', line 210 in wrapper
return controller(request, media=media, *args, **kwargs)
File '/path/to/mediagoblin/mediagoblin/decorators.py', line 170 in wrapper
return controller(request, page=page, *args, **kwargs)
File '/path/to/mediagoblin/mediagoblin/user_pages/views.py', line 170 in media_home
context)
File '/path/to/mediagoblin/mediagoblin/tools/response.py', line 36 in render_to_response
render_template(request, template, context),
File '/path/to/mediagoblin/mediagoblin/tools/template.py', line 144 in render_template
rendered = template.render(context)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/environment.py', line 969 in render
return self.environment.handle_exception(exc_info, True)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/environment.py', line 742 in handle_exception
reraise(exc_type, exc_value, tb)
File '/path/to/mediagoblin/mediagoblin/templates/mediagoblin/media_displays/video.html', line 19 in top-level template code
{% extends 'mediagoblin/user_pages/media.html' %}
File '/path/to/mediagoblin/mediagoblin/templates/mediagoblin/user_pages/media.html', line 21 in top-level template code
{% from "mediagoblin/utils/pagination.html" import render_pagination %}
File '/var/lib/mediagoblin/templates/mediagoblin/base.html', line 64 in top-level template code
{% block mediagoblin_body %}
File '/var/lib/mediagoblin/templates/mediagoblin/base.html', line 203 in block "mediagoblin_body"
{% block mediagoblin_content %}
File '/path/to/mediagoblin/mediagoblin/templates/mediagoblin/user_pages/media.html', line 136 in block "mediagoblin_content"
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/environment.py', line 397 in getattr
return getattr(obj, attribute)
UndefinedError: 'mediagoblin.db.models.Graveyard object' has no attribute 'get_actor'
The problematic code is in {% for comment in comments %}
{% set comment_author = comment.get_actor %}
<li id="comment-{{ comment.id }}"
{%- if pagination.active_id == comment.id %}
class="comment_wrapper comment_active">
<a name="comment" id="comment"></a>
{%- else %}
class="comment_wrapper">
{%- endif %}
<div class="comment_author">
<img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
user=comment_author.username) }}"
class="comment_authorlink">
{{- comment_author.username -}}
</a>
<a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
comment=comment.id,
user=media.get_actor.username,
media=media.slug_or_id) }}#comment"
class="comment_whenlink">
<span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
{%- trans formatted_time=timesince(comment.created) -%}
{{ formatted_time }} ago
{%- endtrans -%}
</span></a>:
</div>
|
|||
