summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-11-28 16:28:28 +0100
committerDan McGee <dan@archlinux.org>2012-11-28 16:28:28 +0100
commitfc7eb4aebf63525155bcadd366a87eed8f161568 (patch)
tree0f859882f8b3ae820e4a41266409494a91f5b64e
parenteea25558c766d5f3a32879d16e579d051906cbf3 (diff)
downloadarchweb-fc7eb4aebf63525155bcadd366a87eed8f161568.tar.gz
archweb-fc7eb4aebf63525155bcadd366a87eed8f161568.tar.xz
Add safe_mode filter to news admin; preview uses safe mode
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--news/admin.py3
-rw-r--r--news/views.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/news/admin.py b/news/admin.py
index ad3cf51..acceb51 100644
--- a/news/admin.py
+++ b/news/admin.py
@@ -4,7 +4,8 @@ from .models import News
class NewsAdmin(admin.ModelAdmin):
list_display = ('title', 'author', 'postdate', 'last_modified', 'safe_mode')
- list_filter = ('postdate', 'author')
+ list_filter = ('postdate', 'author', 'safe_mode')
search_fields = ('title', 'content')
+ date_hierarchy = 'postdate'
admin.site.register(News, NewsAdmin)
diff --git a/news/views.py b/news/views.py
index efd93fd..0e22ac3 100644
--- a/news/views.py
+++ b/news/views.py
@@ -76,7 +76,7 @@ def view_redirect(request, object_id):
@require_POST
def preview(request):
data = request.POST.get('data', '')
- markup = markdown.markdown(data, safe_mode=False, enable_attributes=False)
+ markup = markdown.markdown(data, safe_mode=True, enable_attributes=False)
return HttpResponse(markup)
# vim: set ts=4 sw=4 et: