Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
1e5bb80d
Commit
1e5bb80d
authored
Aug 22, 2012
by
benjaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:benjaoming/django-wiki
parents
832d7903
221fca1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
wiki/decorators.py
+2
-2
wiki/templates/wiki/error.html
+27
-0
No files found.
wiki/decorators.py
View file @
1e5bb80d
...
...
@@ -71,8 +71,8 @@ def get_article(func=None, can_read=True, can_write=False,
parent
=
models
.
URLPath
.
get_by_path
(
path
)
return
redirect
(
reverse
(
"wiki:create"
,
kwargs
=
{
'path'
:
parent
.
path
,})
+
"?slug=
%
s"
%
pathlist
[
-
1
])
except
models
.
URLPath
.
DoesNotExist
:
# TODO: Make a nice page
return
HttpResponseNotFound
(
"This article was not found, and neither was the parent. This page should look nicer."
)
c
=
RequestContext
(
request
,
{
'error_type'
:
'ancestors_missing'
})
return
HttpResponseNotFound
(
render_to_string
(
"wiki/error.html"
,
context_instance
=
c
)
)
if
urlpath
.
article
:
# urlpath is already smart about prefetching items on article (like current_revision), so we don't have to
article
=
urlpath
.
article
...
...
wiki/templates/wiki/error.html
0 → 100644
View file @
1e5bb80d
{% extends "wiki/base.html" %}
{% load wiki_tags i18n %}
{% load url from future %}
{% block pagetitle %}{{ article.current_revision.title }}{% endblock %}
{% block wiki_breadcrumbs %}
{% include "wiki/includes/breadcrumbs.html" %}
{% endblock %}
{% block wiki_contents %}
{% if error_type == "ancestors_missing" %}
<div
class=
"missing"
>
<p>
This article was not found, and neither was its parent article.
<a
href=
"{% url 'wiki:get' path='' %}"
>
Go back to the main wiki article
</a></p>
</div>
{% else %}
<div
class=
"error"
>
<p>
There was some sort of error accessing this page. Sorry!
</p>
</div>
{% endif %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment