aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-06-05 15:25:45 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-06-05 16:16:03 +0200
commit1c63ad5d352f5eb38a4d634b9aea84cbeee269a4 (patch)
treefadd0802b4e6952873446bffc39be273cc4d65ef /mediagoblin/user_pages
parent99619a625b20d4c5825eeb52753657b088db5381 (diff)
downloadmediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.tar.lz
mediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.tar.xz
mediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.zip
Create render_to_reponse and use it everywhere.
Just a shortcut for Response(render_template(...))
Diffstat (limited to 'mediagoblin/user_pages')
-rw-r--r--mediagoblin/user_pages/views.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 6ea3fe36..0442e736 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -14,9 +14,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from webob import Response, exc
+from webob import exc
from mediagoblin.db.util import DESCENDING
-from mediagoblin.util import Pagination, render_template
+from mediagoblin.util import Pagination, render_to_response
from mediagoblin.decorators import uses_pagination, get_user_media_entry
@@ -42,21 +42,19 @@ def user_home(request, page):
if media_entries == None:
return exc.HTTPNotFound()
- return Response(
- render_template(
+ return render_to_response(
request, 'mediagoblin/user_pages/user.html',
{'user': user,
'media_entries': media_entries,
- 'pagination': pagination}))
+ 'pagination': pagination})
@get_user_media_entry
def media_home(request, media):
"""'Homepage' of a MediaEntry()"""
- return Response(
- render_template(
+ return render_to_response(
request, 'mediagoblin/user_pages/media.html',
- {'media': media}))
+ {'media': media})
ATOM_DEFAULT_NR_OF_UPDATED_ITEMS = 5