From b1f996d7b554d0d8a2ae44e0b017477a9ee429bf Mon Sep 17 00:00:00 2001 From: tilly-Q Date: Thu, 9 Jan 2014 18:17:38 -0500 Subject: [PATCH] This is a very minor change that makes it possible for plugins to provide an alternative to the default root_view. --- mediagoblin/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mediagoblin/views.py b/mediagoblin/views.py index 4185c1b6..12b1b386 100644 --- a/mediagoblin/views.py +++ b/mediagoblin/views.py @@ -17,13 +17,14 @@ 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 -- 2.25.1