Skip to content

Commit

Permalink
Merge pull request #121 from Connexions/update-template-path
Browse files Browse the repository at this point in the history
🐛 Update template paths in views after templates are moved
  • Loading branch information
Michael Mulich committed Mar 10, 2016
2 parents f1f65db + a2928a5 commit d9fe70a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include *.txt *.rst
recursive-include cnxpublishing/sql *.sql
recursive-include cnxpublishing/sql/migrations *.py
recursive-include cnxpublishing/tests/data *.*
recursive-include cnxpublishing/templates *.*
recursive-include cnxpublishing/views/templates *.*
8 changes: 4 additions & 4 deletions cnxpublishing/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@view_config(route_name='admin-index', request_method='GET',
renderer="cnxpublishing:templates/index.html",
renderer="cnxpublishing.views:templates/index.html",
permission='preview')
def admin_index(request): # pragma: no cover
return {
Expand All @@ -29,17 +29,17 @@ def admin_index(request): # pragma: no cover


@view_config(route_name='admin-moderation', request_method='GET',
renderer="cnxpublishing:templates/moderations.html",
renderer="cnxpublishing.views:templates/moderations.html",
permission='moderate')
@view_config(route_name='moderation-rss', request_method='GET',
renderer="cnxpublishing:templates/moderations.rss",
renderer="cnxpublishing.views:templates/moderations.rss",
permission='view')
def admin_moderations(request): # pragma: no cover
return {'moderations': get_moderation(request)}


@view_config(route_name='admin-api-keys', request_method='GET',
renderer="cnxpublishing:templates/api-keys.html",
renderer="cnxpublishing.views:templates/api-keys.html",
permission='administer')
def admin_api_keys(request): # pragma: no cover
# Easter Egg that will invalidate the cache, just hit this page.
Expand Down
5 changes: 3 additions & 2 deletions cnxpublishing/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@forbidden_view_config()
def forbidden(request):
if request.path.startswith('/a/'):
path = request.route_path('login', _query={'redirect': '/a/'})
return httpexceptions.HTTPFound(location=path)
if not request.unauthenticated_userid:
path = request.route_path('login', _query={'redirect': '/a/'})
return httpexceptions.HTTPFound(location=path)
return httpexceptions.HTTPForbidden()

0 comments on commit d9fe70a

Please sign in to comment.