diff --git a/markupwiki/models.py b/markupwiki/models.py
index 8ff4517..620c6e0 100644
--- a/markupwiki/models.py
+++ b/markupwiki/models.py
@@ -36,7 +36,7 @@ class Article(models.Model):
title = models.CharField(max_length=200)
creator = models.ForeignKey(User, related_name='wiki_articles', blank=True, null=True)
status = models.IntegerField(choices=ARTICLE_STATUSES, default=PUBLIC)
- redirect_to = models.ForeignKey('self', null=True)
+ redirect_to = models.ForeignKey('self', blank=True, null=True)
def __unicode__(self):
return self.title
diff --git a/markupwiki/templates/markupwiki/history.html b/markupwiki/templates/markupwiki/history.html
index 17b8512..f413498 100644
--- a/markupwiki/templates/markupwiki/history.html
+++ b/markupwiki/templates/markupwiki/history.html
@@ -12,6 +12,32 @@
{% endblock %}
{% block article_body %}
+
+
+
Version |
@@ -46,4 +72,5 @@
Compare Selected Versions
+
{% endblock %}
diff --git a/markupwiki/urls.py b/markupwiki/urls.py
index 1826718..9c64557 100644
--- a/markupwiki/urls.py
+++ b/markupwiki/urls.py
@@ -12,5 +12,6 @@ urlpatterns = patterns('markupwiki.views',
url(WIKI_REGEX + '/history/$', 'article_history', name='article_history'),
url(WIKI_REGEX + '/history/(?P\d+)/$', 'view_article', name='article_version'),
url(WIKI_REGEX + '/diff/$', 'article_diff', name='article_diff'),
+ url(WIKI_REGEX + '/revert/$', 'revert', name='revert'),
url(WIKI_REGEX + '/$', 'view_article', name='view_article'),
)
diff --git a/markupwiki/views.py b/markupwiki/views.py
index 5e226d7..b475f46 100644
--- a/markupwiki/views.py
+++ b/markupwiki/views.py
@@ -8,7 +8,7 @@ from django.contrib import messages
from django.http import Http404
from django.template import RequestContext
from django.utils.functional import wraps
-from markupwiki.models import Article, PUBLIC, DELETED, LOCKED
+from markupwiki.models import Article, ArticleVersion, PUBLIC, DELETED, LOCKED
from markupwiki.forms import ArticleForm, StaffModerationForm, ArticleRenameForm
CREATE_MISSING_ARTICLE = getattr(settings,
@@ -169,7 +169,7 @@ def revert(request, title):
'''
article = get_object_or_404(Article, title=title)
revision_id = int(request.POST['revision'])
- revision = get_object_or_404(revision, number=revision_id)
+ revision = get_object_or_404(article.versions, number=revision_id)
ArticleVersion.objects.create(article=article, author=request.user,
number=article.versions.latest().number,
comment='reverted to r%s' % revision_id,