Attempt to get csrf tag working in django 1.1-

This commit is contained in:
Martin Green 2011-05-02 03:11:17 +01:00
parent 925ed4635b
commit 289b882a15
3 changed files with 13 additions and 1 deletions

View File

@ -451,10 +451,12 @@ class Cave(TroggleModel):
return res
def getCaveByReference(reference):
print reference
areaname, code = reference.split("-", 1)
print areaname, code
area = Area.objects.get(short_name = areaname)
print area
foundCaves = list(Cave.objects.filter(area = area, kataster_number = code).all()) + list(Cave.objects.filter(area = area, unofficial_number = code).all())
print list(foundCaves)
assert len(foundCaves) == 1
return foundCaves[0]

9
templates/csrffaker.py Normal file
View File

@ -0,0 +1,9 @@
import django
if django.VERSION[0] >=1 and django.VERSION[1] > 1:
pass
else:
from django import template
register = template.Library()
@register.tag
def csrf_token(parser, token): return ""

View File

@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load csrffaker %}
{% block title %}Logbook {{logbookentry.id}}{% endblock %}
{% block head %}
<script>