mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-01-20 09:52:30 +00:00
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
|
return res
|
||||||
|
|
||||||
def getCaveByReference(reference):
|
def getCaveByReference(reference):
|
||||||
print reference
|
|
||||||
areaname, code = reference.split("-", 1)
|
areaname, code = reference.split("-", 1)
|
||||||
|
print areaname, code
|
||||||
area = Area.objects.get(short_name = areaname)
|
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())
|
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
|
assert len(foundCaves) == 1
|
||||||
return foundCaves[0]
|
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" %}
|
{% extends "base.html" %}
|
||||||
|
{% load csrffaker %}
|
||||||
{% block title %}Logbook {{logbookentry.id}}{% endblock %}
|
{% block title %}Logbook {{logbookentry.id}}{% endblock %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user