This is a very minor change that makes it possible for plugins to provide an
authortilly-Q <nattilypigeonfowl@gmail.com>
Thu, 9 Jan 2014 23:17:38 +0000 (18:17 -0500)
committertilly-Q <nattilypigeonfowl@gmail.com>
Fri, 10 Jan 2014 18:01:19 +0000 (13:01 -0500)
alternative to the default root_view.

mediagoblin/views.py

index 4185c1b695870176d7d956a5b98de01f986faad6..12b1b386af4770eca95468636f3ae7ba0768e909 100644 (file)
 from mediagoblin import mg_globals
 from mediagoblin.db.models import MediaEntry
 from mediagoblin.tools.pagination import Pagination
+from mediagoblin.tools.pluginapi import hook_handle
 from mediagoblin.tools.response import render_to_response, render_404
 from mediagoblin.decorators import uses_pagination, user_not_banned
 
 
 @user_not_banned
 @uses_pagination
-def root_view(request, page):
+def default_root_view(request, page):
     cursor = MediaEntry.query.filter_by(state=u'processed').\
         order_by(MediaEntry.created.desc())
 
@@ -51,3 +52,5 @@ def terms_of_service(request):
 
     return render_to_response(request,
         'mediagoblin/terms_of_service.html', {})
+
+root_view = hook_handle("frontpage_view") or default_root_view