forked from expo/troggle
Attempt to get csrf tag working in django 1.1-
This commit is contained in:
parent
925ed4635b
commit
289b882a15
@ -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
9
templates/csrffaker.py
Normal 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 ""
|
@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% load csrffaker %}
|
||||
{% block title %}Logbook {{logbookentry.id}}{% endblock %}
|
||||
{% block head %}
|
||||
<script>
|
||||
|
Loading…
Reference in New Issue
Block a user