Commit 6d20678c by benjaoming

Merge branch 'master' of github.com:benjaoming/django-wiki

parents f8a6e1c3 7f820b66
...@@ -88,7 +88,7 @@ class Create(FormView, ArticleMixin): ...@@ -88,7 +88,7 @@ class Create(FormView, ArticleMixin):
# TODO: Handle individual exceptions better and give good feedback. # TODO: Handle individual exceptions better and give good feedback.
except Exception, e: except Exception, e:
transaction.rollback() transaction.rollback()
if self.request.user.is_superuser(): if self.request.user.is_superuser:
messages.error(self.request, _(u"There was an error creating this article: %s") % str(e)) messages.error(self.request, _(u"There was an error creating this article: %s") % str(e))
else: else:
messages.error(self.request, _(u"There was an error creating this article.")) messages.error(self.request, _(u"There was an error creating this article."))
...@@ -678,7 +678,7 @@ def root_create(request): ...@@ -678,7 +678,7 @@ def root_create(request):
return redirect('wiki:get', path=root.path) return redirect('wiki:get', path=root.path)
except NoRootURL: except NoRootURL:
pass pass
if not request.user.is_superuser(): if not request.user.is_superuser:
return redirect(settings.LOGIN_URL + "?next=" + reverse("wiki:root_create")) return redirect(settings.LOGIN_URL + "?next=" + reverse("wiki:root_create"))
if request.method == 'POST': if request.method == 'POST':
create_form = forms.CreateRootForm(request.POST) create_form = forms.CreateRootForm(request.POST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment