summaryrefslogtreecommitdiffstats
path: root/flatpages
diff options
context:
space:
mode:
authorSam Wenham <sam@wenhams.co.uk>2019-03-30 17:02:07 +0000
committerSam Wenham <sam@wenhams.co.uk>2019-03-30 17:02:07 +0000
commit64a4842dcbcbe10c5edb057c0000659f2809c1f9 (patch)
treea1ee35a80efb0e73ace1bc217de069760396e8f1 /flatpages
parenta4532a29da6c2a92553daeafbd3c7eca5b42f861 (diff)
downloadtroggle-64a4842dcbcbe10c5edb057c0000659f2809c1f9.tar.gz
troggle-64a4842dcbcbe10c5edb057c0000659f2809c1f9.tar.bz2
troggle-64a4842dcbcbe10c5edb057c0000659f2809c1f9.zip
Remove the redundant render_with_context() as django now does this just with the
render() shortcut Move from mimetype to content_type, missed in last commit
Diffstat (limited to 'flatpages')
-rw-r--r--flatpages/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/flatpages/views.py b/flatpages/views.py
index 8bc25ba..6360393 100644
--- a/flatpages/views.py
+++ b/flatpages/views.py
@@ -1,6 +1,6 @@
import troggle.settings as settings
from troggle.helper import login_required_if_public
-from utils import render_with_context
+from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
@@ -47,13 +47,13 @@ def flatpage(request, path):
o = open(os.path.normpath(settings.EXPOWEB + path + "index.htm"), "rb")
path = path + "index.htm"
except IOError:
- return render_with_context(request, 'pagenotfound.html', {'path': path})
+ return render(request, 'pagenotfound.html', {'path': path})
else:
try:
filetobeopened = os.path.normpath(settings.EXPOWEB + path)
o = open(filetobeopened, "rb")
except IOError:
- return render_with_context(request, 'pagenotfound.html', {'path': path})
+ return render(request, 'pagenotfound.html', {'path': path})
if path.endswith(".htm") or path.endswith(".html"):
html = o.read()
@@ -75,7 +75,7 @@ def flatpage(request, path):
if re.search(r"iso-8859-1", html):
body = unicode(body, "iso-8859-1")
body.strip
- return render_with_context(request, 'flatpage.html', {'editable': True, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu})
+ return render(request, 'flatpage.html', {'editable': True, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu})
else:
return HttpResponse(o.read(), content_type=getmimetype(path))
@@ -160,7 +160,7 @@ def editflatpage(request, path):
flatpageForm = FlatPageForm({"html": body, "title": title})
else:
flatpageForm = FlatPageForm()
- return render_with_context(request, 'editflatpage.html', {'path': path, 'form': flatpageForm, })
+ return render(request, 'editflatpage.html', {'path': path, 'form': flatpageForm, })
class FlatPageForm(forms.Form):
title = forms.CharField(widget=forms.TextInput(attrs={'size':'60'}))