aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/views.py
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2013-09-03 17:46:55 +0200
committerSebastian Spaeth <Sebastian@SSpaeth.de>2013-09-03 17:52:28 +0200
commit51b4318079d2dce51e58be3f5ea95bc825301e54 (patch)
tree63111e48f1315e03914dcc6b1e3dbc6dc08bc6b1 /mediagoblin/user_pages/views.py
parent6375cf735c3cc5b0a2b761545d546106e1de3b2d (diff)
downloadmediagoblin-51b4318079d2dce51e58be3f5ea95bc825301e54.tar.lz
mediagoblin-51b4318079d2dce51e58be3f5ea95bc825301e54.tar.xz
mediagoblin-51b4318079d2dce51e58be3f5ea95bc825301e54.zip
Simplify non-active user page
Currently, the logic of whether a user account has been activated is in the main user.html template. This is not good as: doing that check for all users from template code is probably not great for performance, but more severly, the template logic is rather difficult and convoluted. Split this in a user.html and a user_nonactive.html where user.html is used for active users and user_nonactive displays all the "you still need to be activated" blurbs. This makes the templates much easier on the eyes.
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r--mediagoblin/user_pages/views.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 49691a29..ac39c4ba 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -47,16 +47,13 @@ _log.setLevel(logging.DEBUG)
@uses_pagination
def user_home(request, page):
"""'Homepage' of a User()"""
- # TODO: decide if we only want homepages for active users, we can
- # then use the @get_active_user decorator and also simplify the
- # template html.
user = User.query.filter_by(username=request.matchdict['user']).first()
if not user:
return render_404(request)
elif user.status != u'active':
return render_to_response(
request,
- 'mediagoblin/user_pages/user.html',
+ 'mediagoblin/user_pages/user_nonactive.html',
{'user': user})
cursor = MediaEntry.query.\